summaryrefslogtreecommitdiff
path: root/include/llvm/Support/StandardPasses.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/StandardPasses.h')
-rw-r--r--include/llvm/Support/StandardPasses.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h
index 1b40ede14b..deee00e686 100644
--- a/include/llvm/Support/StandardPasses.h
+++ b/include/llvm/Support/StandardPasses.h
@@ -72,6 +72,7 @@ namespace llvm {
static inline void createStandardFunctionPasses(PassManagerBase *PM,
unsigned OptimizationLevel) {
if (OptimizationLevel > 0) {
+ PM->add(createBasicAliasAnalysisPass());
PM->add(createCFGSimplificationPass());
if (OptimizationLevel == 1)
PM->add(createPromoteMemoryToRegisterPass());
@@ -91,6 +92,8 @@ namespace llvm {
bool SimplifyLibCalls,
bool HaveExceptions,
Pass *InliningPass) {
+ PM->add(createBasicAliasAnalysisPass());
+
if (OptimizationLevel == 0) {
if (InliningPass)
PM->add(InliningPass);
@@ -177,6 +180,9 @@ namespace llvm {
bool Internalize,
bool RunInliner,
bool VerifyEach) {
+ // Provide AliasAnalysis services for optimizations.
+ PM->add(createBasicAliasAnalysisPass());
+
// Now that composite has been compiled, scan through the module, looking
// for a main function. If main is defined, mark all other functions
// internal.