annotate include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h @ 148:63bd29f05246

merged
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 19:46:37 +0900
parents c2174574ed3a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
1 //===---- AlignmentFromAssumptions.h ----------------------------*- C++ -*-===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
2 //
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 120
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 120
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 120
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
6 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
8 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
9 // This file implements a ScalarEvolution-based transformation to set
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
10 // the alignments of load, stores and memory intrinsics based on the truth
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
11 // expressions of assume intrinsics. The primary motivation is to handle
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
12 // complex alignment assumptions that apply to vector loads and stores that
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
13 // appear after vectorization and unrolling.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
14 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
15 //===----------------------------------------------------------------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
16
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
17 #ifndef LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
18 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
19
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
20 #include "llvm/Analysis/ScalarEvolution.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
21 #include "llvm/IR/Function.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
22 #include "llvm/IR/IntrinsicInst.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
23 #include "llvm/IR/PassManager.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
24
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
25 namespace llvm {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
26
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
27 struct AlignmentFromAssumptionsPass
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
28 : public PassInfoMixin<AlignmentFromAssumptionsPass> {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
29 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
30
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
31 // Glue for old PM.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
32 bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
33 DominatorTree *DT_);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
34
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
35 ScalarEvolution *SE = nullptr;
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
36 DominatorTree *DT = nullptr;
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
37
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
38 bool extractAlignmentInfo(CallInst *I, Value *&AAPtr, const SCEV *&AlignSCEV,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
39 const SCEV *&OffSCEV);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
40 bool processAssumption(CallInst *I);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
41 };
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
42 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
43
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
44 #endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H