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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 17:21:38 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, hfinkel, eli.friedman.
Herald added a subscriber: dmgreen.

When nodes are reassociated the vector-reduction flag gets lost.

The test case is here is what would happen if you had a sum of absolute differences loop that started with a non-zero but contant sum and that loop was unrolled. The vectorizer will generate a constant vector for the initial value. And DAGCombiner reassociate tries to move it down the addition tree erasing the vector-reduction flag. Interestingly this moves constants the opposite direction of the reassociate IR pass.

I've chosen to just punt on the reassociate, but I suppose we could maybe preserve the flag if both nodes have it set.


https://reviews.llvm.org/D50827

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/sad.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50827.160949.patch
Type: text/x-patch
Size: 8785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180816/4e0a1c7d/attachment.bin>


More information about the llvm-commits mailing list