diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2012-02-24 17:53:59 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2012-02-24 17:53:59 +0000 |
| commit | b9a3d61894a2a2d0eac7a3baed3b127ecfb2435a (patch) | |
| tree | 06f8b881468cab61dc1434b225081d5fd7c213f4 /llvm | |
| parent | 3a08c1cd3bb40eaabc096697389b8507c719092b (diff) | |
| download | bcm5719-llvm-b9a3d61894a2a2d0eac7a3baed3b127ecfb2435a.tar.gz bcm5719-llvm-b9a3d61894a2a2d0eac7a3baed3b127ecfb2435a.zip | |
Don't crash when a glue node contains an internal CopyToReg
This is necessary to support the existing ppc lowering code for indirect calls.
Fixes PR12071.
llvm-svn: 151373
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/ppc64-ind-call.ll | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index 3f4f9e26254..1467d887789 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -766,6 +766,9 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, if (F->getOpcode() == ISD::CopyFromReg) { UsedRegs.push_back(cast<RegisterSDNode>(F->getOperand(1))->getReg()); continue; + } else if (F->getOpcode() == ISD::CopyToReg) { + // Skip CopyToReg nodes that are internal to the glue chain. + continue; } // Collect declared implicit uses. const MCInstrDesc &MCID = TII->get(F->getMachineOpcode()); diff --git a/llvm/test/CodeGen/PowerPC/ppc64-ind-call.ll b/llvm/test/CodeGen/PowerPC/ppc64-ind-call.ll new file mode 100644 index 00000000000..f2d7cb489ed --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/ppc64-ind-call.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s -march=ppc64 | FileCheck %s +target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +define void @test1() { +entry: + %call.i75 = call zeroext i8 undef(i8* undef, i8 zeroext 10) + unreachable +} + +; CHECK: @test1 + |

