Don't select binary instructions with illegal types.

llvm-svn: 55383
This commit is contained in:
Dan Gohman 2008-08-26 20:52:40 +00:00
parent 3c4dc434ee
commit 3bcbbece19
1 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,12 @@ bool FastISel::SelectBinaryOp(Instruction *I, ISD::NodeType ISDOpcode,
if (VT == MVT::Other || !VT.isSimple())
// Unhandled type. Halt "fast" selection and bail.
return false;
// We only handle legal types. For example, on x86-32 the instruction
// selector contains all of the 64-bit instructions from x86-64,
// under the assumption that i64 won't be used if the target doesn't
// support it.
if (!TLI.isTypeLegal(VT))
return false;
unsigned Op0 = ValueMap[I->getOperand(0)];
if (Op0 == 0)