aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-01 06:11:53 +0000
committerChris Lattner <sabre@nondot.org>2009-11-01 06:11:53 +0000
commit1a8b80ed5a76cc27eb3553f0abc6c83b69552d3e (patch)
tree6f07b5dee68699490a78d280efebfae760d45944 /llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
parenta1dc101f66ef44cdb4f9e74168fb71196be236a1 (diff)
downloadllvm-1a8b80ed5a76cc27eb3553f0abc6c83b69552d3e.zip
llvm-1a8b80ed5a76cc27eb3553f0abc6c83b69552d3e.tar.gz
llvm-1a8b80ed5a76cc27eb3553f0abc6c83b69552d3e.tar.bz2
teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a function
in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c to pass with the new indirect goto lowering. llvm-svn: 85709
Diffstat (limited to 'llvm/lib/Transforms/IPO/IPConstantPropagation.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/IPConstantPropagation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
index d9b2e30..023e642 100644
--- a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -86,6 +86,9 @@ bool IPCP::PropagateConstantsIntoArguments(Function &F) {
unsigned NumNonconstant = 0;
for (Value::use_iterator UI = F.use_begin(), E = F.use_end(); UI != E; ++UI) {
+ // Ignore blockaddress uses.
+ if (isa<BlockAddress>(*UI)) continue;
+
// Used by a non-instruction, or not the callee of a function, do not
// transform.
if (!isa<CallInst>(*UI) && !isa<InvokeInst>(*UI))