[llvm] 7bbde17 - [ARM] Add a PreferNoCSEL option. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 04:42:54 PDT 2020


Author: David Green
Date: 2020-07-16T12:42:07+01:00
New Revision: 7bbde17e62aafa487dbcb170ca07d0aed4833adc

URL: https://github.com/llvm/llvm-project/commit/7bbde17e62aafa487dbcb170ca07d0aed4833adc
DIFF: https://github.com/llvm/llvm-project/commit/7bbde17e62aafa487dbcb170ca07d0aed4833adc.diff

LOG: [ARM] Add a PreferNoCSEL option. NFC

This disables CSEL, falling back to the old predicated move behaviour
for cases where that is useful for debugging.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/Thumb2InstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
index 6ada546e5f48..43942316b80e 100644
--- a/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
+++ b/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
@@ -39,6 +39,11 @@ OldT2IfCvt("old-thumb2-ifcvt", cl::Hidden,
            cl::desc("Use old-style Thumb2 if-conversion heuristics"),
            cl::init(false));
 
+static cl::opt<bool>
+PreferNoCSEL("prefer-no-csel", cl::Hidden,
+             cl::desc("Prefer predicated Move to CSEL"),
+             cl::init(false));
+
 Thumb2InstrInfo::Thumb2InstrInfo(const ARMSubtarget &STI)
     : ARMBaseInstrInfo(STI) {}
 
@@ -127,7 +132,7 @@ Thumb2InstrInfo::optimizeSelect(MachineInstr &MI,
   // MOVCC into another instruction. If that fails on 8.1-M fall back to using a
   // CSEL.
   MachineInstr *RV = ARMBaseInstrInfo::optimizeSelect(MI, SeenMIs, PreferFalse);
-  if (!RV && getSubtarget().hasV8_1MMainlineOps()) {
+  if (!RV && getSubtarget().hasV8_1MMainlineOps() && !PreferNoCSEL) {
     Register DestReg = MI.getOperand(0).getReg();
 
     if (!DestReg.isVirtual())


        


More information about the llvm-commits mailing list