LLVM  14.0.0git
AlignmentFromAssumptions.h
Go to the documentation of this file.
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.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
18 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
19 
20 #include "llvm/IR/PassManager.h"
21 
22 namespace llvm {
23 
24 class AssumptionCache;
25 class DominatorTree;
26 class ScalarEvolution;
27 class SCEV;
28 
30  : public PassInfoMixin<AlignmentFromAssumptionsPass> {
32 
33  // Glue for old PM.
35  DominatorTree *DT_);
36 
37  ScalarEvolution *SE = nullptr;
38  DominatorTree *DT = nullptr;
39 
40  bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr,
41  const SCEV *&AlignSCEV, const SCEV *&OffSCEV);
42  bool processAssumption(CallInst *I, unsigned Idx);
43 };
44 }
45 
46 #endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::AlignmentFromAssumptionsPass::processAssumption
bool processAssumption(CallInst *I, unsigned Idx)
Definition: AlignmentFromAssumptions.cpp:236
llvm::AlignmentFromAssumptionsPass::DT
DominatorTree * DT
Definition: AlignmentFromAssumptions.h:38
llvm::AlignmentFromAssumptionsPass
Definition: AlignmentFromAssumptions.h:29
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Function
Definition: Function.h:62
llvm::AlignmentFromAssumptionsPass::SE
ScalarEvolution * SE
Definition: AlignmentFromAssumptions.h:37
llvm::ScalarEvolution
The main scalar evolution driver.
Definition: ScalarEvolution.h:460
llvm::DominatorTree
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:151
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo
bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr, const SCEV *&AlignSCEV, const SCEV *&OffSCEV)
Definition: AlignmentFromAssumptions.cpp:209
llvm::AlignmentFromAssumptionsPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: AlignmentFromAssumptions.cpp:352
llvm::SCEV
This class represents an analyzed expression in the program.
Definition: ScalarEvolution.h:77
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::AssumptionCache
A cache of @llvm.assume calls within a function.
Definition: AssumptionCache.h:41
PassManager.h
llvm::AlignmentFromAssumptionsPass::runImpl
bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_, DominatorTree *DT_)
Definition: AlignmentFromAssumptions.cpp:334
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1475
llvm::Value
LLVM Value Representation.
Definition: Value.h:74