summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-09-28 10:01:27 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-09-28 10:01:27 +0000
commited84360a4507a33f2f79e36857f25aa5717076c1 (patch)
treea7ce027b69aad3ad7ffcc24d5254c02f6eb0b8e5 /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parent156999f8b9cee34f2c0fd516f8d3050060ad2c14 (diff)
downloadbcm5719-llvm-ed84360a4507a33f2f79e36857f25aa5717076c1.tar.gz
bcm5719-llvm-ed84360a4507a33f2f79e36857f25aa5717076c1.zip
GlobalOpt: non-constexpr bitcasts or GEPs can occur even if the global value is only stored once.
Fixes PR13968. llvm-svn: 164815
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index b888e959820..b1ba6be5ff6 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -962,7 +962,9 @@ static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV,
// If we get here we could have other crazy uses that are transitively
// loaded.
assert((isa<PHINode>(GlobalUser) || isa<SelectInst>(GlobalUser) ||
- isa<ConstantExpr>(GlobalUser) || isa<CmpInst>(GlobalUser)) &&
+ isa<ConstantExpr>(GlobalUser) || isa<CmpInst>(GlobalUser) ||
+ isa<BitCastInst>(GlobalUser) ||
+ isa<GetElementPtrInst>(GlobalUser)) &&
"Only expect load and stores!");
}
}
OpenPOWER on IntegriCloud