LLVM 20.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
22namespace llvm {
23
24class AssumptionCache;
25class CallInst;
26class DominatorTree;
27class ScalarEvolution;
28class SCEV;
29class Value;
30
32 : public PassInfoMixin<AlignmentFromAssumptionsPass> {
34
35 // Glue for old PM.
37 DominatorTree *DT_);
38
39 ScalarEvolution *SE = nullptr;
40 DominatorTree *DT = nullptr;
41
42 bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr,
43 const SCEV *&AlignSCEV, const SCEV *&OffSCEV);
44 bool processAssumption(CallInst *I, unsigned Idx);
45};
46}
47
48#endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
A cache of @llvm.assume calls within a function.
This class represents a function call, abstracting a target machine's calling convention.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:162
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
This class represents an analyzed expression in the program.
The main scalar evolution driver.
LLVM Value Representation.
Definition: Value.h:74
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr, const SCEV *&AlignSCEV, const SCEV *&OffSCEV)
bool processAssumption(CallInst *I, unsigned Idx)
bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_, DominatorTree *DT_)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69