[PATCH] D43716: [EarlyCSE] Exploit open ended invariant.start scopes

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 20:32:34 PST 2018


reames created this revision.
reames added reviewers: anna, spatel, gberry.
Herald added subscribers: bollu, mcrosier.

If we have an invariant.start with no corresponding invariant.end, then the memory location becomes invariant indefinitely after the invariant.start.  As a result, anything dominated by the start is guaranteed to see the value the memory location had when the invariant.start executed.

This patch adds an AvailableInvariants table which tracks the generation a particular memory location became invariant and then uses that information to allow value forwarding that would otherwise be disallowed by potentially aliasing stores.  (Reminder: In EarlyCSE everything clobbers everything by default.)

This should be compatible with the MemorySSA variant, but design is generational.  We can and should add first class support for invariant.start within MemorySSA at a later time.


Repository:
  rL LLVM

https://reviews.llvm.org/D43716

Files:
  lib/Transforms/Scalar/EarlyCSE.cpp
  test/Transforms/EarlyCSE/invariant-loads.ll
  test/Transforms/EarlyCSE/invariant.start.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43716.135772.patch
Type: text/x-patch
Size: 16029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180224/fc24049e/attachment.bin>


More information about the llvm-commits mailing list