summaryrefslogtreecommitdiff
path: root/include/llvm/LinkAllPasses.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-01 11:40:11 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-01 11:40:11 +0000
commit3cd652d5304135c8264b1fd63095ab3e47ae73a4 (patch)
treef1e1d8217cb7104f5fecc50a5f47da567ad62dfd /include/llvm/LinkAllPasses.h
parent3aac788365086260b4f8318c5563db54cd2d97fb (diff)
downloadllvm-3cd652d5304135c8264b1fd63095ab3e47ae73a4.tar.gz
llvm-3cd652d5304135c8264b1fd63095ab3e47ae73a4.tar.bz2
llvm-3cd652d5304135c8264b1fd63095ab3e47ae73a4.tar.xz
Add a small pass that sets the readnone/readonly
attributes on functions, based on the result of alias analysis. It's not hardwired to use GlobalsModRef even though this is the only (AFAIK) alias analysis that results in this pass actually doing something. Enable as follows: opt ... -globalsmodref-aa -markmodref ... Advantages of this pass: (1) records the result of globalsmodref in the bitcode, meaning it is available for use by later passes (currently the pass manager isn't smart enough to magically make an advanced alias analysis available to all later passes), which may expose more optimization opportunities; (2) hopefully speeds up compilation when code is optimized twice, for example when a file is compiled to bitcode, then later LTO is done on it: marking functions readonly/readnone when producing the initial bitcode should speed up alias analysis during LTO; (3) good for discovering that globalsmodref doesn't work very well :) Not currently turned on by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/LinkAllPasses.h')
-rw-r--r--include/llvm/LinkAllPasses.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/llvm/LinkAllPasses.h b/include/llvm/LinkAllPasses.h
index aabebf766a..9e82e67507 100644
--- a/include/llvm/LinkAllPasses.h
+++ b/include/llvm/LinkAllPasses.h
@@ -85,6 +85,7 @@ namespace {
(void) llvm::createLowerInvokePass();
(void) llvm::createLowerSetJmpPass();
(void) llvm::createLowerSwitchPass();
+ (void) llvm::createMarkModRefPass();
(void) llvm::createNoAAPass();
(void) llvm::createNoProfileInfoPass();
(void) llvm::createProfileLoaderPass();