Go to the documentation of this file.
42 if (
auto *GA = dyn_cast<GlobalAlias>(
C)) {
43 auto *NewAliasee = canonicalizeAlias(GA->getAliasee(), Changed);
44 if (NewAliasee != GA->getAliasee()) {
45 GA->setAliasee(NewAliasee);
51 auto *
CE = dyn_cast<ConstantExpr>(
C);
55 std::vector<Constant *> Ops;
56 for (
Use &U :
CE->operands())
57 Ops.push_back(canonicalizeAlias(cast<Constant>(U), Changed));
58 return CE->getWithOperands(Ops);
62 static bool canonicalizeAliases(
Module &M) {
64 for (
auto &GA :
M.aliases())
65 canonicalizeAlias(&GA, Changed);
70 class CanonicalizeAliasesLegacyPass :
public ModulePass {
77 StringRef getPassName()
const override {
return "Canonicalize Aliases"; }
79 explicit CanonicalizeAliasesLegacyPass() :
ModulePass(
ID) {}
81 bool runOnModule(
Module &M)
override {
return canonicalizeAliases(M); }
89 if (!canonicalizeAliases(
M))
96 "Canonicalize aliases",
false,
false)
102 return new CanonicalizeAliasesLegacyPass();
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
INITIALIZE_PASS_BEGIN(CanonicalizeAliasesLegacyPass, "canonicalize-aliases", "Canonicalize aliases", false, false) INITIALIZE_PASS_END(CanonicalizeAliasesLegacyPass
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
ModulePass * createCanonicalizeAliasesPass()
(vector float) vec_cmpeq(*A, *B) C
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
This is an important base class in LLVM.
@ CE
Windows NT (Windows on ARM)
A Module instance is used to store all the information related to an LLVM module.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
StringRef - Represent a constant reference to a string, i.e.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
A container for analyses that lazily runs them and caches their results.
A Use represents the edge between a Value definition and its users.