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
This commit is contained in:
Chris Lattner
2009-11-01 06:11:53 +00:00
parent 882029269e
commit b2710041fb
2 changed files with 7 additions and 2 deletions

View File

@ -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))