diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 06:11:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 06:11:53 +0000 |
commit | 2f4875062faa6cad24c7ada735dba0877b5da634 (patch) | |
tree | 50d3cafef4ad8bc95ca5fbb0e3141525eab1c2c3 /lib/Transforms/IPO/IPConstantPropagation.cpp | |
parent | cab3885bac1d1f297b73a1ea491eeeb870758b27 (diff) | |
download | external_llvm-2f4875062faa6cad24c7ada735dba0877b5da634.zip external_llvm-2f4875062faa6cad24c7ada735dba0877b5da634.tar.gz external_llvm-2f4875062faa6cad24c7ada735dba0877b5da634.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/IPConstantPropagation.cpp')
-rw-r--r-- | lib/Transforms/IPO/IPConstantPropagation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index d9b2e30..023e642 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/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)) |