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

           Summary: SelectionDAG does not handle scalar second operand to
                    sign_extend_inreg correctly
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


In SelectionDAG.cpp::UnrollVectorOp the cases for SIGN_EXTEND_INREG and
FP_ROUND_INREG incorrectly assume that the second operand is always a vector
and uses the API function getVectorElementType(). The correct function call to
use is getScalarType so that LLVM does not assert when a scalar is used as the
extension value for a vector type.

Old Code:
 case ISD::SIGN_EXTEND_INREG:
    case ISD::FP_ROUND_INREG: {
          EVT ExtVT =
dyn_cast<VTSDNode>(Operands[1])->getVT().getVectorElementType();
      Scalars.push_back(getNode(N->getOpcode(), dl, EltVT,
                                Operands[0],
                                getValueType(ExtVT)));
    }

New Code:
 case ISD::SIGN_EXTEND_INREG:
    case ISD::FP_ROUND_INREG: {
          EVT ExtVT = dyn_cast<VTSDNode>(Operands[1])->getVT().getScalarType();
      Scalars.push_back(getNode(N->getOpcode(), dl, EltVT,
                                Operands[0],
                                getValueType(ExtVT)));
    }


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to