[llvm-commits] [llvm] r46525 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp

Duncan Sands baldrick at free.fr
Tue Jan 29 11:29:08 PST 2008


Author: baldrick
Date: Tue Jan 29 13:29:08 2008
New Revision: 46525

URL: http://llvm.org/viewvc/llvm-project?rev=46525&view=rev
Log:
When expanding an operand, it's not the result value
type that matters but the operand type.  This fixes
2008-01-08-IllegalCMP.ll which crashed with the new
legalize infrastructure because SETCC with result
type i8 and operand type i64 was being custom expanded
by the X86 backend.  With this fix, the gcc build gets
as far as the first libcall.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Tue Jan 29 13:29:08 2008
@@ -747,8 +747,8 @@
   DEBUG(cerr << "Expand node operand: "; N->dump(&DAG); cerr << "\n");
   SDOperand Res(0, 0);
   
-  if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) == 
-      TargetLowering::Custom)
+  if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
+      == TargetLowering::Custom)
     Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
   
   if (Res.Val == 0) {





More information about the llvm-commits mailing list