[PATCH] D60036: [CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.

Luqman Aden via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 30 14:39:15 PDT 2019


luqmana created this revision.
luqmana added reviewers: sanjoy, apilipenko, nikic.
Herald added subscribers: llvm-commits, jdoerfert, jfb, hiraditya.
Herald added a project: LLVM.

Teach CorrelatedValuePropagation to also handle sub instructions in addition to add. Relatively simple since makeGuaranteedNoWrapRegion already understood sub instructions. Only subtle change is which range is passed as "Other" to that function, since sub isn't commutative.

Note that CorrelatedValuePropagation::processAddSub is still hidden behind a default-off flag as IndVarSimplify hasn't yet been fixed to strip the added nsw/nuw flags and causes a miscompile. (PR31181)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60036

Files:
  llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
  llvm/test/Transforms/CorrelatedValuePropagation/add.ll
  llvm/test/Transforms/CorrelatedValuePropagation/sub.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60036.192992.patch
Type: text/x-patch
Size: 12596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190330/05c89f6d/attachment.bin>


More information about the llvm-commits mailing list