[llvm-commits] [llvm] r151373 - in /llvm/trunk: lib/CodeGen/SelectionDAG/InstrEmitter.cpp test/CodeGen/PowerPC/ppc64-ind-call.ll

Hal Finkel hfinkel at anl.gov
Fri Feb 24 09:53:59 PST 2012


Author: hfinkel
Date: Fri Feb 24 11:53:59 2012
New Revision: 151373

URL: http://llvm.org/viewvc/llvm-project?rev=151373&view=rev
Log:
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.

Added:
    llvm/trunk/test/CodeGen/PowerPC/ppc64-ind-call.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=151373&r1=151372&r2=151373&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Fri Feb 24 11:53:59 2012
@@ -766,6 +766,9 @@
       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());

Added: llvm/trunk/test/CodeGen/PowerPC/ppc64-ind-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc64-ind-call.ll?rev=151373&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/ppc64-ind-call.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/ppc64-ind-call.ll Fri Feb 24 11:53:59 2012
@@ -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
+





More information about the llvm-commits mailing list