[llvm] [NVPTX] Fix lowering of i1 SETCC (PR #115035)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 21:15:58 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.
----------------
AlexMaclean wrote:
I can update to make the comment more descriptive but I'm not sure about narrowing the logic. `isCondCodeLegal` is used it lots of places to prevent combines that would produce illegal nodes and I'm not sure there would be a benefit to performing this combine if the resulting nodes are not legal. Further, Custom legalization or promotion could still maybe result in some sort of infinite loop. Is is alright if I leave the check as is?
https://github.com/llvm/llvm-project/pull/115035
More information about the llvm-commits
mailing list