[LLVMbugs] [Bug 6336] New: SelectionDAG does not handle scalar second operand to sign_extend_inreg correctly

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Feb 17 17:04:32 PST 2010


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: unassignedbugs at nondot.org
        ReportedBy: micah.villmow at amd.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list