From fe32f969cde265eff6fb2b9ef84507db5b44cefd Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 7 Dec 2009 23:10:34 +0000 Subject: [PATCH] Follow up to 90488. Turn a check into an assertion. llvm-svn: 90815 --- lib/CodeGen/MachineInstr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 3f4a92804c4..12b974d30be 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -1064,8 +1064,8 @@ bool MachineInstr::isInvariantLoad(AliasAnalysis *AA) const { unsigned MachineInstr::isConstantValuePHI() const { if (getOpcode() != TargetInstrInfo::PHI) return 0; - if (getNumOperands() <= 1) - return 0; + assert(getNumOperands() >= 3 && + "It's illegal to have a PHI without source operands"); unsigned Reg = getOperand(1).getReg(); for (unsigned i = 3, e = getNumOperands(); i < e; i += 2)