[PATCH] D73727: [SLP] drop poison-generating flags for shuffle reduction ops (PR44536)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 10:40:57 PST 2020


spatel created this revision.
spatel added reviewers: aqjune, ABataev, RKSimon, lebedev.ri.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.
spatel updated this revision to Diff 241511.
spatel added a comment.

Patch updated:
Uploaded a wrong draft of the patch initially - the flag-dropping should be done *inside* the loop to apply to all ops in the reduction.


We may calculate reassociable math ops in arbitrary order when creating a shuffle reduction, so there's no guarantee that things like 'nsw' hold on those intermediate values. Drop all poison-generating flags for safety.

This change is limited to shuffle reductions because I don't think we have a problem in the general case (where we intersect flags of each scalar op that goes into a vector op), but if there's evidence of other cases being wrong, we can extend this fix to cover those cases.

https://bugs.llvm.org/show_bug.cgi?id=44536


https://reviews.llvm.org/D73727

Files:
  llvm/lib/Transforms/Utils/LoopUtils.cpp
  llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
  llvm/test/Transforms/SLPVectorizer/X86/remark_horcost.ll
  llvm/test/Transforms/SLPVectorizer/X86/scheduling.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73727.241511.patch
Type: text/x-patch
Size: 16359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200130/431e24a4/attachment.bin>


More information about the llvm-commits mailing list