[PATCH] D15124: Use @llvm.invariant.start/end intrinsics to extend the meaning of basic AA's pointsToConstantMemory(), for GVN-based load elimination purposes

Larisse Voufo via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 12:14:10 PST 2015


lvoufo created this revision.
lvoufo added reviewers: reames, nlewycky, chandlerc.
lvoufo added a subscriber: llvm-commits.

A new pass is added, -invariant-info-marker, that facilitates the management of invariant info as @llvm.invariant.start/end intrinsic  calls are processed within GVN (and memdep analysis) and the result of the process is exploited by basic AA to determine if a given load instruction can be merged into a previous one.

The -invariant-info-marker pass is essentially modeled after the -assumption-cache-tracker pass, but is only required in -gvn, which in turns requires memdep analysis and basic AA. Both memdep analysis and basic AA then have access to invariant info whenever -gvn is enabled.

Within a given invariant_start/end intrinsic calls pair, loads from the same pointer value can be combined as they are not clobbered by interleaving function calls. A test case is added that demonstrates this load elimination.


http://reviews.llvm.org/D15124

Files:
  include/llvm/Analysis/BasicAliasAnalysis.h
  include/llvm/Analysis/InvariantInfo.h
  include/llvm/Analysis/MemoryDependenceAnalysis.h
  include/llvm/InitializePasses.h
  lib/Analysis/BasicAliasAnalysis.cpp
  lib/Analysis/CMakeLists.txt
  lib/Analysis/InvariantInfo.cpp
  lib/Analysis/MemoryDependenceAnalysis.cpp
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/LoadElim/invariant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15124.41549.patch
Type: text/x-patch
Size: 23433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151201/95f3bed4/attachment.bin>


More information about the llvm-commits mailing list