From 04b0a3e65132dc2d357232780da636a08ecef25a Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 30 Oct 2010 21:25:26 +0000 Subject: [PATCH] Make sure we have a legal type (and simple) before continuing. llvm-svn: 117848 --- llvm/lib/Target/ARM/ARMFastISel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index 8a5b73eef803..5d85187a7b44 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -939,8 +939,11 @@ bool ARMFastISel::SelectBranch(const Instruction *I) { // TODO: Factor this out. if (const CmpInst *CI = dyn_cast(BI->getCondition())) { if (CI->hasOneUse() && (CI->getParent() == I->getParent())) { + EVT VT; const Type *Ty = CI->getOperand(0)->getType(); - EVT VT = TLI.getValueType(Ty); + if (!isTypeLegal(Ty, VT)) + return false; + bool isFloat = (Ty->isDoubleTy() || Ty->isFloatTy()); if (isFloat && !Subtarget->hasVFP2()) return false;