summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-09-07 20:05:11 +0000
committerHal Finkel <hfinkel@anl.gov>2014-09-07 20:05:11 +0000
commitd67e4639016ec7bb1ad3e41b199f7ad11eaee09f (patch)
treed1972496fafdaf91ad83d0feb27bf2d078499446 /llvm/include/llvm-c
parent15aeaaf24adf73b4d9bbcc619fb6165fdb50591a (diff)
downloadbcm5719-llvm-d67e4639016ec7bb1ad3e41b199f7ad11eaee09f.tar.gz
bcm5719-llvm-d67e4639016ec7bb1ad3e41b199f7ad11eaee09f.zip
Add an AlignmentFromAssumptions Pass
This adds 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 ValueTracking, 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 for which this kind of logic is necessary. The primary motivation is to fixup alignments for vector loads/stores after vectorization (and unrolling). This pass is added to the optimization pipeline just after the SLP vectorizer runs (which, admittedly, does not preserve SE, although I imagine it could). Regardless, I actually don't think that the preservation matters too much in this case: SE computes lazily, and this pass won't issue any SE queries unless there are any assume intrinsics, so there should be no real additional cost in the common case (SLP does preserve DT and LoopInfo). llvm-svn: 217344
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/Transforms/Scalar.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Transforms/Scalar.h b/llvm/include/llvm-c/Transforms/Scalar.h
index c0d670e3050..a8ad772624b 100644
--- a/llvm/include/llvm-c/Transforms/Scalar.h
+++ b/llvm/include/llvm-c/Transforms/Scalar.h
@@ -35,6 +35,9 @@ extern "C" {
/** See llvm::createAggressiveDCEPass function. */
void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
+/** See llvm::createAlignmentFromAssumptionsPass function. */
+void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
+
/** See llvm::createCFGSimplificationPass function. */
void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
OpenPOWER on IntegriCloud