[llvm] [AMDGPU][AArch64][SelectionDAG] Added target hook check for SelectwithConstant (PR #127599)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 21:55:34 PST 2025
================
@@ -28189,7 +28189,7 @@ SDValue DAGCombiner::SimplifySelectCC(const SDLoc &DL, SDValue N0, SDValue N1,
bool Fold = N2C && isNullConstant(N3) && N2C->getAPIntValue().isPowerOf2();
bool Swap = N3C && isNullConstant(N2) && N3C->getAPIntValue().isPowerOf2();
- if ((Fold || Swap) &&
+ if (TLI.convertSelectOfConstantsToMath(VT) && (Fold || Swap) &&
TLI.getBooleanContents(CmpOpVT) ==
TargetLowering::ZeroOrOneBooleanContent &&
(!LegalOperations || TLI.isOperationLegal(ISD::SETCC, CmpOpVT))) {
----------------
arsenm wrote:
```suggestion
if ((Fold || Swap) &&
TLI.getBooleanContents(CmpOpVT) ==
TargetLowering::ZeroOrOneBooleanContent &&
(!LegalOperations || TLI.isOperationLegal(ISD::SETCC, CmpOpVT)) &&
TLI.convertSelectOfConstantsToMath(VT)) {
```
Order the complex checks last
https://github.com/llvm/llvm-project/pull/127599
More information about the llvm-commits
mailing list