[LLVMbugs] [Bug 7993] New: LegalizeOp produces illegal type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 25 23:56:33 PDT 2010


           Summary: LegalizeOp produces illegal type
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu

The following example crashes

$ llc  -march=x86-64 -mattr=-sse2 foo.ll

define <4 x i32> @test3(<4 x i16> %a) nounwind {
  %c = sext <4 x i16> %a to <4 x i32>             ; <<4 x i32>> [#uses=1]
  ret <4 x i32> %c

This is because this code in legalizedag.cpp:

        case TargetLowering::Expand:
          if (!TLI.isLoadExtLegal(ISD::EXTLOAD, SrcVT)) {
            // FIXME: If SrcVT isn't legal, then this introduces an illegal
            // type.
            SDValue Load = DAG.getLoad(SrcVT, dl, Tmp1, Tmp2,
                                       LD->isVolatile(), LD->isNonTemporal(),
            unsigned ExtendOp;
            switch (ExtType) {
            case ISD::EXTLOAD:
              ExtendOp = (SrcVT.isFloatingPoint() ?
                          ISD::FP_EXTEND : ISD::ANY_EXTEND);
            case ISD::SEXTLOAD: ExtendOp = ISD::SIGN_EXTEND; break;
            case ISD::ZEXTLOAD: ExtendOp = ISD::ZERO_EXTEND; break;
            default: llvm_unreachable("Unexpected extend load type!");
            Result = DAG.getNode(ExtendOp, dl, Node->getValueType(0), Load);
            Tmp1 = LegalizeOp(Result);  // Relegalize new nodes.
            Tmp2 = LegalizeOp(Load.getValue(1));

produces a load of the extload's load VT, if that isn't legal, then this
produces a node with an invalid type, after type legalization has run.  Are the
extloads invalid?

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