The following code would not work before this patch, due to the inability to take...
authorChris Dewhurst <chris.dewhurst@lero.ie>
Fri, 22 Apr 2016 08:13:47 +0000 (08:13 +0000)
committerChris Dewhurst <chris.dewhurst@lero.ie>
Fri, 22 Apr 2016 08:13:47 +0000 (08:13 +0000)
void func1() {

...
}

int main(int argc, char** argv) {

void (*pFunc)();
pFunc = &func1
pFunc();
...
}

Phabricator review: http://reviews.llvm.org/D19368

llvm-svn: 267120

llvm/lib/Target/Sparc/DelaySlotFiller.cpp

index 3124439..0062428 100644 (file)
@@ -296,7 +296,7 @@ void Filler::insertCallDefsUses(MachineBasicBlock::iterator MI,
     RegUses.insert(Reg.getReg());
 
     const MachineOperand &RegOrImm = MI->getOperand(1);
-    if (RegOrImm.isImm())
+    if (RegOrImm.isImm() || RegOrImm.isGlobal())
         break;
     assert(RegOrImm.isReg() && "CALLrr second operand is not a register.");
     assert(RegOrImm.isUse() && "CALLrr second operand is not a use.");