[PATCH] D41235: [DAGCOmbine] Ensure that (brcond (setcc ...)) is handled in a canonical manner.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 1 17:10:21 PST 2018


deadalnix added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7014
+
+  return Combined;
 }
----------------
niravd wrote:
> Should this be "return SDValue();"?
I think this is correct. If no combine is found, then SDValue is returned (line 6999) and if there is, the code tries to rebuild a setcc if that is a preferred form and if not, then we just have the combine done :)


================
Comment at: test/CodeGen/X86/live-out-reg-info.ll:15
+; CHECK-NEXT:    movl %edi, %eax
+; CHECK-NEXT:    shrl $23, %eax
+; CHECK-NEXT:    testb $1, %ah
----------------
niravd wrote:
> It looks like all the bittest patterns are no longer being matched because of the DAG change. 
Could you point me to the code that generate these patterns so it can be fixed ?

More generally, this match is likely broken half the time in the wild right now, because the form generated depends on the order in which nodes are processed in the DAGCombiner.


https://reviews.llvm.org/D41235





More information about the llvm-commits mailing list