[llvm] [NVPTX] Fix lowering of i1 SETCC (PR #115035)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 15:49:53 PST 2024
================
@@ -18753,7 +18753,9 @@ SDValue DAGCombiner::rebuildSetCC(SDValue N) {
EVT SetCCVT = N.getValueType();
if (LegalTypes)
SetCCVT = getSetCCResultType(SetCCVT);
- // Replace the uses of XOR with SETCC
+ // Replace the uses of XOR with SETCC. Note, avoid this transformation if
+ // it would introduce illegal operations post-legalization as this can
+ // result in an infinite loop.
----------------
Artem-B wrote:
"result in an infite loop" could use more details. " converting it to xor->setcc here, and expanding setcc->xor if the back-end requested it."
Speaking of which. I assume the infinite loop affects only targets that have `Expand` set on the op. Can we narrow the condition from `!Legal` to `==Expand` ?
https://github.com/llvm/llvm-project/pull/115035
More information about the llvm-commits
mailing list