aboutsummaryrefslogtreecommitdiffstats
path: root/tools/opt
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-19 14:34:36 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-19 14:34:36 +0000
commit210fada2c6bb31198722000e52059e41f6641c3b (patch)
tree55a17319586a5d0b4c6c2a2596b594e0eed5a35c /tools/opt
parenta01febbcc0c93796b2fd8562de0f53586e908ec8 (diff)
downloadexternal_llvm-210fada2c6bb31198722000e52059e41f6641c3b.zip
external_llvm-210fada2c6bb31198722000e52059e41f6641c3b.tar.gz
external_llvm-210fada2c6bb31198722000e52059e41f6641c3b.tar.bz2
Turn on the AddReadAttrs pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r--tools/opt/opt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index ae07610..ea6ed33 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -288,8 +288,10 @@ inline void addPass(PassManager &PM, Pass *P) {
}
MPM.add(createInstructionCombiningPass()); // Clean up after IPCP & DAE
MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
- if (UnitAtATime)
+ if (UnitAtATime) {
MPM.add(createPruneEHPass()); // Remove dead EH info
+ MPM.add(createAddReadAttrsPass()); // Set readonly/readnone attrs
+ }
if (OptLevel > 1)
MPM.add(createFunctionInliningPass()); // Inline small functions
if (OptLevel > 2)
@@ -360,6 +362,7 @@ void AddStandardCompilePasses(PassManager &PM) {
addPass(PM, createCFGSimplificationPass()); // Clean up after IPCP & DAE
addPass(PM, createPruneEHPass()); // Remove dead EH info
+ addPass(PM, createAddReadAttrsPass()); // Set readonly/readnone attrs
if (!DisableInline)
addPass(PM, createFunctionInliningPass()); // Inline small functions