[llvm] [SDAG] Turn umin into smin if the saturation pattern is broken (PR #88505)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 07:26:24 PDT 2024
================
@@ -5589,7 +5592,7 @@ SDValue DAGCombiner::visitIMINMAX(SDNode *N) {
case ISD::UMAX: AltOpcode = ISD::SMAX; break;
default: llvm_unreachable("Unknown MINMAX opcode");
}
- if (TLI.isOperationLegal(AltOpcode, VT))
+ if (IsSatBroken || TLI.isOperationLegal(AltOpcode, VT))
----------------
RKSimon wrote:
Should we limit this to `(!LegalOperations && IsSatBroken) || TLI.isOperationLegal(AltOpcode, VT)`?
https://github.com/llvm/llvm-project/pull/88505
More information about the llvm-commits
mailing list