[llvm-commits] [llvm] r55383 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Dan Gohman gohman at apple.com
Tue Aug 26 13:52:40 PDT 2008


Author: djg
Date: Tue Aug 26 15:52:40 2008
New Revision: 55383

URL: http://llvm.org/viewvc/llvm-project?rev=55383&view=rev
Log:
Don't select binary instructions with illegal types.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55383&r1=55382&r2=55383&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Aug 26 15:52:40 2008
@@ -30,6 +30,12 @@
   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)





More information about the llvm-commits mailing list