1 //===---- AlignmentFromAssumptions.h ----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements a ScalarEvolution-based transformation to set
11 // the alignments of load, stores and memory intrinsics based on the truth
12 // expressions of assume intrinsics. The primary motivation is to handle
13 // complex alignment assumptions that apply to vector loads and stores that
14 // appear after vectorization and unrolling.
16 //===----------------------------------------------------------------------===//
18 #ifndef LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
19 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
21 #include "llvm/Analysis/ScalarEvolution.h"
22 #include "llvm/IR/Function.h"
23 #include "llvm/IR/IntrinsicInst.h"
24 #include "llvm/IR/PassManager.h"
28 struct AlignmentFromAssumptionsPass
29 : public PassInfoMixin<AlignmentFromAssumptionsPass> {
30 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
33 bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_,
36 ScalarEvolution *SE = nullptr;
37 DominatorTree *DT = nullptr;
39 bool extractAlignmentInfo(CallInst *I, Value *&AAPtr, const SCEV *&AlignSCEV,
40 const SCEV *&OffSCEV);
41 bool processAssumption(CallInst *I);
45 #endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H