[llvm-commits] [llvm] r55820 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp

Dan Gohman gohman at apple.com
Thu Sep 4 18:33:56 PDT 2008


Author: djg
Date: Thu Sep  4 20:33:56 2008
New Revision: 55820

URL: http://llvm.org/viewvc/llvm-project?rev=55820&view=rev
Log:
Check a comparion's operand type for legality before
expanding its operands.

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=55820&r1=55819&r2=55820&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Thu Sep  4 20:33:56 2008
@@ -262,15 +262,15 @@
 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;





More information about the llvm-commits mailing list