[PATCH] D54955: [SLP]Fix PR39774: Set ReductionRoot if the original instruction is vectorized.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 08:40:22 PST 2018


ABataev created this revision.
ABataev added reviewers: RKSimon, spatel, hfinkel, mkuper.

If the original reduction root instruction was vectorized, it might be
removed from the tree. It means that the insertion point may become
invalidated and the whole vectorization of the reduction leads to the
incorrect output result.
The ReductionRoot instruction must be marked as externally used so it
could not be removed. Otherwise it might cause inconsistency with the
cost model and we may end up with too optimistic optimization.


Repository:
  rL LLVM

https://reviews.llvm.org/D54955

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/PR39774.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54955.175496.patch
Type: text/x-patch
Size: 7394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/56dd8da5/attachment.bin>


More information about the llvm-commits mailing list