[llvm] r348219 - [MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

Jessica Paquette via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 16:31:47 PST 2018


Author: paquette
Date: Mon Dec  3 16:31:47 2018
New Revision: 348219

URL: http://llvm.org/viewvc/llvm-project?rev=348219&view=rev
Log:
[MachineOutliner][AArch64][NFC] Add early exit to candidate discarding logic

If we dropped too many candidates to be beneficial when dropping candidates
that modify the stack, there's no reason to check for other cost model
qualities.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=348219&r1=348218&r2=348219&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Mon Dec  3 16:31:47 2018
@@ -5214,6 +5214,12 @@ AArch64InstrInfo::getOutliningCandidateI
     } else {
       SetCandidateCallInfo(MachineOutlinerDefault, 12);
     }
+
+    // If we dropped all of the candidates, bail out here.
+    if (RepeatedSequenceLocs.size() < 2) {
+      RepeatedSequenceLocs.clear();
+      return outliner::OutlinedFunction();
+    }
   }
 
   // Does every candidate's MBB contain a call? If so, then we might have a call




More information about the llvm-commits mailing list