[PATCH] D50827: [DAGCombiner] Don't reassociate operations that have the vector reduction flag set.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 05:08:03 PDT 2018


spatel added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:953-954
+    // Don't reassociate reductions.
+    if (N0->getFlags().hasVectorReduction())
+      return SDValue();
+
----------------
Not sure if this is possible: what if the root node and N1 do not have the reduction flag set? In that case, we want to allow the 'if' clause at line 975 to fire even though N0 has the reduction flag set rather than bailing out?


================
Comment at: test/CodeGen/X86/sad.ll:1401
+; DAGCombiner reassociation previously rewrote the adds to move the constant vector further down the tree. This resulted in the vector-reduction flag being lost.
+define i32 @sad_unroll_nonzero_initial(<16 x i8>* %arg, <16 x i8>* %arg1, <16 x i8>* %arg2, <16 x i8>* %arg3) {
+; SSE2-LABEL: sad_unroll_nonzero_initial:
----------------
Please commit the test with baseline checks as a preliminary step.


https://reviews.llvm.org/D50827





More information about the llvm-commits mailing list