[StackMaps] Enable patchpoint liveness analysis per default.
authorJuergen Ributzka <juergen@apple.com>
Thu, 26 Jun 2014 23:39:52 +0000 (23:39 +0000)
committerJuergen Ributzka <juergen@apple.com>
Thu, 26 Jun 2014 23:39:52 +0000 (23:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211817 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/StackMapLivenessAnalysis.h
lib/CodeGen/Passes.cpp
lib/CodeGen/StackMapLivenessAnalysis.cpp
test/CodeGen/X86/stackmap-liveness.ll

index 651ca6b914a3f68974feb36b7c4d6947bf4b914c..6f07546162066f04ad959eff49ec5977e8f19b0e 100644 (file)
@@ -26,10 +26,10 @@ namespace llvm {
 /// a function and attaches the register live-out information to a patchpoint
 /// intrinsic if present.
 ///
-/// This is an optional pass that has to be explicitly enabled via the
-/// -enable-patchpoint-liveness flag. The pass skips functions that don't have
-/// any patchpoint intrinsics. The information provided by this pass is optional
-/// and not required by the aformentioned intrinsic to function.
+/// This pass can be disabled via the -enable-patchpoint-liveness=false flag.
+/// The pass skips functions that don't have any patchpoint intrinsics. The
+/// information provided by this pass is optional and not required by the
+/// aformentioned intrinsic to function.
 class StackMapLiveness : public MachineFunctionPass {
   MachineFunction *MF;
   const TargetRegisterInfo *TRI;
index bdcde102daa6b4268af77339ab2270733a860854..4eec623e07911d1ccf557514a718cb73280c818e 100644 (file)
 
 using namespace llvm;
 
-namespace llvm {
-extern cl::opt<bool> EnablePatchPointLiveness;
-}
-
 static cl::opt<bool> DisablePostRA("disable-post-ra", cl::Hidden,
     cl::desc("Disable Post Regalloc"));
 static cl::opt<bool> DisableBranchFold("disable-branch-fold", cl::Hidden,
@@ -565,8 +561,7 @@ void TargetPassConfig::addMachinePasses() {
   if (addPreEmitPass())
     printAndVerify("After PreEmit passes");
 
-  if (EnablePatchPointLiveness)
-    addPass(&StackMapLivenessID);
+  addPass(&StackMapLivenessID);
 }
 
 /// Add passes that optimize machine instructions in SSA form.
index 16a1babd4dfa4b17b28461f02c33853931a70f49..3ba502fff695f719d27afa4cb422391ada8b8ad6 100644 (file)
@@ -29,7 +29,8 @@ using namespace llvm;
 
 namespace llvm {
 cl::opt<bool> EnablePatchPointLiveness("enable-patchpoint-liveness",
-  cl::Hidden, cl::desc("Enable PatchPoint Liveness Analysis Pass"));
+  cl::Hidden, cl::init(true),
+  cl::desc("Enable PatchPoint Liveness Analysis Pass"));
 }
 
 STATISTIC(NumStackMapFuncVisited, "Number of functions visited");
@@ -60,6 +61,9 @@ void StackMapLiveness::getAnalysisUsage(AnalysisUsage &AU) const {
 
 /// Calculate the liveness information for the given machine function.
 bool StackMapLiveness::runOnMachineFunction(MachineFunction &_MF) {
+  if (!EnablePatchPointLiveness)
+    return false;
+
   DEBUG(dbgs() << "********** COMPUTING STACKMAP LIVENESS: "
                << _MF.getName() << " **********\n");
   MF = &_MF;
@@ -67,7 +71,7 @@ bool StackMapLiveness::runOnMachineFunction(MachineFunction &_MF) {
   ++NumStackMapFuncVisited;
 
   // Skip this function if there are no patchpoints to process.
-  if (!(MF->getFrameInfo()->hasPatchPoint() && EnablePatchPointLiveness)) {
+  if (!MF->getFrameInfo()->hasPatchPoint()) {
     ++NumStackMapFuncSkipped;
     return false;
   }
@@ -88,8 +92,7 @@ bool StackMapLiveness::calculateLiveness() {
     // set to an instruction if we encounter a patchpoint instruction.
     for (MachineBasicBlock::reverse_iterator I = MBBI->rbegin(),
          E = MBBI->rend(); I != E; ++I) {
-      int Opc = I->getOpcode();
-      if (Opc == TargetOpcode::PATCHPOINT) {
+      if (I->getOpcode() == TargetOpcode::PATCHPOINT) {
         addLiveOutSetToMI(*I);
         HasChanged = true;
         HasStackMap = true;
index 78450c7ad2e8b3b2acfc10eaf3cecb094ed72983..897595db2438dc1e7b10ab949a6a79e12aec8188 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim -enable-patchpoint-liveness | FileCheck -check-prefix=PATCH %s
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim -enable-patchpoint-liveness=false | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -disable-fp-elim                                   | FileCheck -check-prefix=PATCH %s
 ;
 ; Note: Print verbose stackmaps using -debug-only=stackmaps.