[LLVMbugs] [Bug 5754] New: LegalizeVectorTypes asserts on Vector SIGN_EXTEND_INREG

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Dec 10 18:43:20 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5754

           Summary: LegalizeVectorTypes asserts on Vector SIGN_EXTEND_INREG
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: micah.villmow at amd.com
                CC: llvmbugs at cs.uiuc.edu


Test case(couresy of Eli Friedman):
define <8 x i32> @a(<8 x i32> %a) {
  %b = trunc <8 x i32> %a to <8 x i16>
  %c = sext <8 x i16> %b to <8 x i32>
  ret <8 x i32> %c
}

Assertion:
LegalizeVectorTypes.cpp:389
 llvm_unreachable("Do not know how to split the result of this operator!");

Proposed Solution:
1) Disable DAG Combination for vector types // fold (sext (truncate x)) ->
(sextinreg x). in ~DAGCombiner.cpp:3024
2) Enable SplitVecRes_SIGN_EXTEND_INREG in LegalizeVectorTypes.cpp:
void DAGTypeLegalizer::SplitVecRes_BinOp(SDNode *N, SDValue &Lo,
                                         SDValue &Hi) {
  SDValue LHSLo, LHSHi;
  GetSplitVector(N->getOperand(0), LHSLo, LHSHi);
  EVT RHSLo, RHSHi;
  GetSplitDestVTs(N->getOperand(1), RHSLo, RHSHi);
  DebugLoc dl = N->getDebugLoc();

  Lo = DAG.getNode(N->getOpcode(), dl, LHSLo.getValueType(), LHSLo,
DAG.getValueType(RHSLo));
  Hi = DAG.getNode(N->getOpcode(), dl, LHSHi.getValueType(), LHSHi,
DAG.getValueType(RHSHi));
}

The second solution causes expansion of sign_extend_inreg to assert because
Operand(1) is of type MVT::Other instead of the same type as Operand(0)


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list