[PATCH] Alignment assumptions using invariants

hfinkel at anl.gov hfinkel at anl.gov
Sun Jul 13 22:00:29 PDT 2014


This is a rebased version of this pass, slightly simplified and with more comments (and a correctness fix so that it actually checks for dominance of the pointer use by the invariant). Generally, it is a ScalarEvolution-powered transformation that updates load, store and memory intrinsic pointer alignments based on invariant((a+q) & b == 0) expressions.

Many of the simple cases we can get with the computeKnownBits patch (http://reviews.llvm.org/D4490), but we still need something like this for the more complicated cases (such as those with an offset) that require some algebra. Note that gcc's __builtin_assume_aligned's optional third argument provides exactly for this kind of 'misalignment' offset.

http://reviews.llvm.org/D181

Files:
  include/llvm-c/Transforms/Scalar.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/AlignmentFromInvariants.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/Scalar.cpp
  test/Transforms/AlignmentFromInvariants/simple.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D181.11361.patch
Type: text/x-patch
Size: 28388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140714/e0bef75d/attachment.bin>


More information about the llvm-commits mailing list