LegalizeDAG: Allow type promotion of scalar loads
authorTom Stellard <thomas.stellard@amd.com>
Mon, 10 Dec 2012 21:41:58 +0000 (21:41 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 10 Dec 2012 21:41:58 +0000 (21:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169773 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index eb8df32e17bc70bda6e555a4bf57a1364c4132fe..2c249fcaf961b5ce33ce63ada34856dff5c2a759 100644 (file)
@@ -890,10 +890,9 @@ void SelectionDAGLegalize::LegalizeLoadOps(SDNode *Node) {
       break;
     }
     case TargetLowering::Promote: {
-      // Only promote a load of vector type to another.
-      assert(VT.isVector() && "Cannot promote this load!");
-      // Change base type to a different vector type.
       EVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
+      assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
+             "Can only promote loads to same size type");
 
       SDValue Res = DAG.getLoad(NVT, dl, Chain, Ptr, LD->getPointerInfo(),
                          LD->isVolatile(), LD->isNonTemporal(),