Skip to content

Commit 1d1f2e8

Browse files
committed
[M68k] Implement TLI::convertSelectOfConstantsToMath
This TLI callback shows the preference of other operations over ISD::SELECT on constant operands. It's essential for M68k because ISD::SELECT tends to lower into M68kISD::CMOV which is not always ideal. This fixes #130754, which showed up after 352c48f.
1 parent 6abe19a commit 1d1f2e8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/M68k/M68kISelLowering.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ class M68kTargetLowering : public TargetLowering {
190190
InlineAsm::ConstraintCode
191191
getInlineAsmMemConstraint(StringRef ConstraintCode) const override;
192192

193+
// We need this for DAGCombiner to eliminate as many ISD::SELECT as possible.
194+
// Otherwise we might end up with M68kISD::CMOV.
195+
bool convertSelectOfConstantsToMath(EVT VT) const override { return true; }
196+
193197
private:
194198
unsigned GetAlignedArgumentStackSize(unsigned StackSize,
195199
SelectionDAG &DAG) const;

0 commit comments

Comments
 (0)