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

Chris Lattner clattner at apple.com
Thu Dec 3 14:01:43 PST 2009


On Dec 3, 2009, at 1:50 PM, Evan Cheng wrote:

> 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.

These aren't valid at the LLVM IR level, are they allowed at MI  
level?  What pass is creating them?

-Chris

>
> 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)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list