OSDN Git Service

Add optimization bisect opt-in calls for AArch64 passes
authorAndrew Kaylor <andrew.kaylor@intel.com>
Mon, 25 Apr 2016 21:58:52 +0000 (21:58 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Mon, 25 Apr 2016 21:58:52 +0000 (21:58 +0000)
Differential Revision: http://reviews.llvm.org/D19394

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

12 files changed:
lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
lib/Target/AArch64/AArch64AddressTypePromotion.cpp
lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp
lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp
lib/Target/AArch64/AArch64CollectLOH.cpp
lib/Target/AArch64/AArch64ConditionOptimizer.cpp
lib/Target/AArch64/AArch64ConditionalCompares.cpp
lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
lib/Target/AArch64/AArch64PromoteConstant.cpp
lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
lib/Target/AArch64/AArch64StorePairSuppress.cpp

index 60daad1..b8f6adb 100644 (file)
@@ -311,6 +311,9 @@ public:
 //===----------------------------------------------------------------------===//
 
 bool AArch64A57FPLoadBalancing::runOnMachineFunction(MachineFunction &F) {
+  if (skipFunction(*F.getFunction()))
+    return false;
+
   // Don't do anything if this isn't an A53 or A57.
   if (!(F.getSubtarget<AArch64Subtarget>().isCortexA53() ||
         F.getSubtarget<AArch64Subtarget>().isCortexA57()))
index 33922fd..62d2120 100644 (file)
@@ -479,6 +479,9 @@ void AArch64AddressTypePromotion::analyzeSExtension(Instructions &SExtInsts) {
 }
 
 bool AArch64AddressTypePromotion::runOnFunction(Function &F) {
+  if (skipFunction(F))
+    return false;
+
   if (!EnableAddressTypePromotion || F.isDeclaration())
     return false;
   Func = &F;
index bec17b1..3d7a7c9 100644 (file)
@@ -402,6 +402,9 @@ bool AArch64AdvSIMDScalar::runOnMachineFunction(MachineFunction &mf) {
   bool Changed = false;
   DEBUG(dbgs() << "***** AArch64AdvSIMDScalar *****\n");
 
+  if (skipFunction(*mf.getFunction()))
+    return false;
+
   MRI = &mf.getRegInfo();
   TII = mf.getSubtarget().getInstrInfo();
 
index 9310ac4..58d3425 100644 (file)
@@ -39,6 +39,9 @@ struct LDTLSCleanup : public MachineFunctionPass {
   LDTLSCleanup() : MachineFunctionPass(ID) {}
 
   bool runOnMachineFunction(MachineFunction &MF) override {
+    if (skipFunction(*MF.getFunction()))
+      return false;
+
     AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
     if (AFI->getNumLocalDynamicTLSAccesses() < 2) {
       // No point folding accesses if there isn't at least two.
index 9e33a27..f4d72e2 100644 (file)
@@ -1041,6 +1041,9 @@ static void collectInvolvedReg(const MachineFunction &MF, MapRegToId &RegToId,
 }
 
 bool AArch64CollectLOH::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
   const MachineDominatorTree *MDT = &getAnalysis<MachineDominatorTree>();
 
index 143fdea..5a11a05 100644 (file)
@@ -318,6 +318,9 @@ bool AArch64ConditionOptimizer::adjustTo(MachineInstr *CmpMI,
 bool AArch64ConditionOptimizer::runOnMachineFunction(MachineFunction &MF) {
   DEBUG(dbgs() << "********** AArch64 Conditional Compares **********\n"
                << "********** Function: " << MF.getName() << '\n');
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   TII = MF.getSubtarget().getInstrInfo();
   DomTree = &getAnalysis<MachineDominatorTree>();
   MRI = &MF.getRegInfo();
index 08569cc..4efbadf 100644 (file)
@@ -889,6 +889,9 @@ bool AArch64ConditionalCompares::tryConvert(MachineBasicBlock *MBB) {
 bool AArch64ConditionalCompares::runOnMachineFunction(MachineFunction &MF) {
   DEBUG(dbgs() << "********** AArch64 Conditional Compares **********\n"
                << "********** Function: " << MF.getName() << '\n');
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   TII = MF.getSubtarget().getInstrInfo();
   TRI = MF.getSubtarget().getRegisterInfo();
   SchedModel = MF.getSubtarget().getSchedModel();
index 54825c4..7a6f766 100644 (file)
@@ -149,6 +149,9 @@ bool AArch64DeadRegisterDefinitions::runOnMachineFunction(MachineFunction &MF) {
   bool Changed = false;
   DEBUG(dbgs() << "***** AArch64DeadRegisterDefinitions *****\n");
 
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   for (auto &MBB : MF)
     if (processMachineBasicBlock(MBB))
       Changed = true;
index ffac39b..7f4aafd 100644 (file)
@@ -1934,6 +1934,9 @@ bool AArch64LoadStoreOpt::enableNarrowLdMerge(MachineFunction &Fn) {
 }
 
 bool AArch64LoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
+  if (skipFunction(*Fn.getFunction()))
+    return false;
+
   Subtarget = &static_cast<const AArch64Subtarget &>(Fn.getSubtarget());
   TII = static_cast<const AArch64InstrInfo *>(Subtarget->getInstrInfo());
   TRI = Subtarget->getRegisterInfo();
index f516602..e8e9947 100644 (file)
@@ -109,6 +109,8 @@ public:
   /// global variables with module scope.
   bool runOnModule(Module &M) override {
     DEBUG(dbgs() << getPassName() << '\n');
+    if (skipModule(M))
+      return false;
     bool Changed = false;
     PromotionCacheTy PromotionCache;
     for (auto &MF : M) {
index 9819ab6..60d8bbd 100644 (file)
@@ -167,6 +167,8 @@ bool AArch64RedundantCopyElimination::optimizeCopy(MachineBasicBlock *MBB) {
 
 bool AArch64RedundantCopyElimination::runOnMachineFunction(
     MachineFunction &MF) {
+  if (skipFunction(*MF.getFunction()))
+    return false;
   TRI = MF.getSubtarget().getRegisterInfo();
   MRI = &MF.getRegInfo();
   bool Changed = false;
index 51efc4c..440f625 100644 (file)
@@ -115,6 +115,9 @@ bool AArch64StorePairSuppress::isNarrowFPStore(const MachineInstr &MI) {
 }
 
 bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(*MF.getFunction()))
+    return false;
+
   const TargetSubtargetInfo &ST = MF.getSubtarget();
   TII = static_cast<const AArch64InstrInfo *>(ST.getInstrInfo());
   TRI = ST.getRegisterInfo();