[llvm] [NVPTX] Fix lowering of i1 SETCC (PR #115035)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 12:21:30 PST 2024


================
@@ -18754,8 +18754,9 @@ SDValue DAGCombiner::rebuildSetCC(SDValue N) {
       if (LegalTypes)
         SetCCVT = getSetCCResultType(SetCCVT);
       // Replace the uses of XOR with SETCC
-      return DAG.getSetCC(SDLoc(N), SetCCVT, Op0, Op1,
-                          Equal ? ISD::SETEQ : ISD::SETNE);
+      const ISD::CondCode CC = Equal ? ISD::SETEQ : ISD::SETNE;
+      if (!LegalOperations || TLI.isCondCodeLegal(CC, Op0.getSimpleValueType()))
----------------
arsenm wrote:

Presumably it will infinite loop the combiner without this 

https://github.com/llvm/llvm-project/pull/115035


More information about the llvm-commits mailing list