[Alignment][NFC] Migrate Instructions to Align
[llvm-core.git] / include / llvm / Transforms / Scalar / AlignmentFromAssumptions.h
blobfb1687e1ac5dea3071dd81b4ee396a954252d8e2
1 //===---- AlignmentFromAssumptions.h ----------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements a ScalarEvolution-based transformation to set
10 // the alignments of load, stores and memory intrinsics based on the truth
11 // expressions of assume intrinsics. The primary motivation is to handle
12 // complex alignment assumptions that apply to vector loads and stores that
13 // appear after vectorization and unrolling.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
18 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
20 #include "llvm/Analysis/ScalarEvolution.h"
21 #include "llvm/IR/Function.h"
22 #include "llvm/IR/IntrinsicInst.h"
23 #include "llvm/IR/PassManager.h"
25 namespace llvm {
27 struct AlignmentFromAssumptionsPass
28 : public PassInfoMixin<AlignmentFromAssumptionsPass> {
29 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
31 // Glue for old PM.
32 bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_,
33 DominatorTree *DT_);
35 ScalarEvolution *SE = nullptr;
36 DominatorTree *DT = nullptr;
38 bool extractAlignmentInfo(CallInst *I, Value *&AAPtr, const SCEV *&AlignSCEV,
39 const SCEV *&OffSCEV);
40 bool processAssumption(CallInst *I);
44 #endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H