From: Duncan Sands Date: Tue, 29 Jan 2008 19:29:08 +0000 (+0000) Subject: When expanding an operand, it's not the result value X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=648f880dc907faf5c05f3d79a424597b65758360;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46525 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp index ec8d6faf484..282137273d9 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp @@ -747,8 +747,8 @@ bool DAGTypeLegalizer::ExpandOperand(SDNode *N, unsigned OpNo) { 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) {