41 if (
auto *GA = dyn_cast<GlobalAlias>(
C)) {
42 auto *NewAliasee = canonicalizeAlias(GA->getAliasee(), Changed);
43 if (NewAliasee != GA->getAliasee()) {
44 GA->setAliasee(NewAliasee);
50 auto *
CE = dyn_cast<ConstantExpr>(
C);
54 std::vector<Constant *> Ops;
55 for (
Use &U :
CE->operands())
56 Ops.push_back(canonicalizeAlias(cast<Constant>(U), Changed));
57 return CE->getWithOperands(Ops);
61static bool canonicalizeAliases(
Module &M) {
63 for (
auto &GA :
M.aliases())
64 canonicalizeAlias(&GA, Changed);
71 if (!canonicalizeAliases(M))
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
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.