[llvm-commits] [llvm] r90488 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Evan Cheng evan.cheng at apple.com
Thu Dec 3 13:50:58 PST 2009


Author: evancheng
Date: Thu Dec  3 15:50:58 2009
New Revision: 90488

URL: http://llvm.org/viewvc/llvm-project?rev=90488&view=rev
Log:
Watch out for PHI instruction with no source operands.

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=90488&r1=90487&r2=90488&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Dec  3 15:50:58 2009
@@ -1064,6 +1064,8 @@
 unsigned MachineInstr::isConstantValuePHI() const {
   if (getOpcode() != TargetInstrInfo::PHI)
     return 0;
+  if (getNumOperands() <= 1)
+    return 0;
 
   unsigned Reg = getOperand(1).getReg();
   for (unsigned i = 3, e = getNumOperands(); i < e; i += 2)





More information about the llvm-commits mailing list