OSDN Git Service

Add optimization bisect opt-in calls for PowerPC passes
authorAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 27 Apr 2016 19:39:32 +0000 (19:39 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 27 Apr 2016 19:39:32 +0000 (19:39 +0000)
Differential Revision: http://reviews.llvm.org/D19554

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267769 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCBoolRetToInt.cpp
lib/Target/PowerPC/PPCCTRLoops.cpp
lib/Target/PowerPC/PPCEarlyReturn.cpp
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
lib/Target/PowerPC/PPCMIPeephole.cpp
lib/Target/PowerPC/PPCQPXLoadSplat.cpp
lib/Target/PowerPC/PPCTargetMachine.cpp
lib/Target/PowerPC/PPCVSXFMAMutate.cpp
lib/Target/PowerPC/PPCVSXSwapRemoval.cpp

index 9ca389f..bfb4d87 100644 (file)
@@ -168,6 +168,9 @@ class PPCBoolRetToInt : public FunctionPass {
   }
 
   bool runOnFunction(Function &F) {
+    if (skipFunction(F))
+      return false;
+
     PHINodeSet PromotablePHINodes = getPromotablePHINodes(F);
     B2IMap Bool2IntMap;
     bool Changed = false;
index 6e1d57a..8752266 100644 (file)
@@ -166,6 +166,9 @@ FunctionPass *llvm::createPPCCTRLoopsVerify() {
 #endif // NDEBUG
 
 bool PPCCTRLoops::runOnFunction(Function &F) {
+  if (skipFunction(F))
+    return false;
+
   LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
   SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
   DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
index 28798c3..fcd2f50 100644 (file)
@@ -173,6 +173,9 @@ protected:
 
 public:
     bool runOnMachineFunction(MachineFunction &MF) override {
+      if (skipFunction(*MF.getFunction()))
+        return false;
+
       TII = MF.getSubtarget().getInstrInfo();
 
       bool Changed = false;
index 5e18826..48a71cf 100644 (file)
@@ -144,6 +144,9 @@ static Value *GetPointerOperand(Value *MemI) {
 }
 
 bool PPCLoopPreIncPrep::runOnFunction(Function &F) {
+  if (skipFunction(F))
+    return false;
+
   LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
   SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
   auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>();
index fe339d7..a57a83d 100644 (file)
@@ -63,6 +63,8 @@ private:
 public:
   // Main entry point for this pass.
   bool runOnMachineFunction(MachineFunction &MF) override {
+    if (skipFunction(*MF.getFunction()))
+      return false;
     initialize(MF);
     return simplifyCode();
   }
index e15751e..642b90e 100644 (file)
@@ -60,6 +60,9 @@ FunctionPass *llvm::createPPCQPXLoadSplatPass() {
 }
 
 bool PPCQPXLoadSplat::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   bool MadeChange = false;
   const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
 
index 3814b7e..b218274 100644 (file)
@@ -382,9 +382,11 @@ void PPCPassConfig::addMachineSSAOptimization() {
 }
 
 void PPCPassConfig::addPreRegAlloc() {
-  initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
-  insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
-             &PPCVSXFMAMutateID);
+  if (getOptLevel() != CodeGenOpt::None) {
+    initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry());
+    insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID,
+               &PPCVSXFMAMutateID);
+  }
   if (getPPCTargetMachine().getRelocationModel() == Reloc::PIC_)
     addPass(createPPCTLSDynamicCallPass());
   if (EnableExtraTOCRegDeps)
index e3580ca..7c22cb2 100644 (file)
@@ -342,6 +342,9 @@ protected:
 
 public:
     bool runOnMachineFunction(MachineFunction &MF) override {
+      if (skipFunction(*MF.getFunction()))
+        return false;
+
       // If we don't have VSX then go ahead and return without doing
       // anything.
       const PPCSubtarget &STI = MF.getSubtarget<PPCSubtarget>();
index 27c540f..10636b8 100644 (file)
@@ -191,6 +191,9 @@ private:
 public:
   // Main entry point for this pass.
   bool runOnMachineFunction(MachineFunction &MF) override {
+    if (skipFunction(*MF.getFunction()))
+      return false;
+
     // If we don't have VSX on the subtarget, don't do anything.
     const PPCSubtarget &STI = MF.getSubtarget<PPCSubtarget>();
     if (!STI.hasVSX())