40 if (
auto *GA = dyn_cast<GlobalAlias>(
C)) {
41 auto *NewAliasee = canonicalizeAlias(GA->getAliasee(), Changed);
42 if (NewAliasee != GA->getAliasee()) {
43 GA->setAliasee(NewAliasee);
49 auto *
CE = dyn_cast<ConstantExpr>(
C);
53 std::vector<Constant *> Ops;
54 for (
Use &U :
CE->operands())
55 Ops.push_back(canonicalizeAlias(cast<Constant>(U), Changed));
56 return CE->getWithOperands(Ops);
60static bool canonicalizeAliases(
Module &M) {
62 for (
auto &GA :
M.aliases())
63 canonicalizeAlias(&GA, Changed);
70 if (!canonicalizeAliases(M))
This file contains the declarations for the subclasses of Constant, which represent the different fla...
A container for analyses that lazily runs them and caches their results.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
This is an important base class in LLVM.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
A Use represents the edge between a Value definition and its users.
@ C
The default llvm calling convention, compatible with C.
@ CE
Windows NT (Windows on ARM)
This is an optimization pass for GlobalISel generic memory operations.