summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-05 01:33:56 +0000
committerDan Gohman <gohman@apple.com>2008-09-05 01:33:56 +0000
commit09faf81b6c6507af95ffc134908dc560577cb027 (patch)
tree5354c20661817ca848efcd5572d6eb088cbf34bf
parentffd89d40d29b156956eb92e314667fef4757bd1f (diff)
downloadbcm5719-llvm-09faf81b6c6507af95ffc134908dc560577cb027.tar.gz
bcm5719-llvm-09faf81b6c6507af95ffc134908dc560577cb027.zip
Check a comparion's operand type for legality before
expanding its operands. llvm-svn: 55820
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 1314f636826..6f6b9908da1 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -262,15 +262,15 @@ bool X86FastISel::X86SelectLoad(Instruction *I) {
bool X86FastISel::X86SelectCmp(Instruction *I) {
CmpInst *CI = cast<CmpInst>(I);
+ MVT VT = TLI.getValueType(I->getOperand(0)->getType());
+ if (!TLI.isTypeLegal(VT))
+ return false;
+
unsigned Op0Reg = getRegForValue(CI->getOperand(0));
if (Op0Reg == 0) return false;
unsigned Op1Reg = getRegForValue(CI->getOperand(1));
if (Op1Reg == 0) return false;
- MVT VT = TLI.getValueType(I->getOperand(0)->getType());
- if (!TLI.isTypeLegal(VT))
- return false;
-
unsigned Opc;
switch (VT.getSimpleVT()) {
case MVT::i8: Opc = X86::CMP8rr; break;
OpenPOWER on IntegriCloud