Skip to content

Commit

Permalink
[ARM] Add a PreferNoCSEL option. NFC
Browse files Browse the repository at this point in the history
This disables CSEL, falling back to the old predicated move behaviour
for cases where that is useful for debugging.
  • Loading branch information
davemgreen committed Jul 16, 2020
1 parent 509351d commit 7bbde17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
Expand Up @@ -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) {}

Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 7bbde17

Please sign in to comment.