OSDN Git Service

[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work...
authorCraig Topper <craig.topper@intel.com>
Fri, 13 Oct 2017 00:18:58 +0000 (00:18 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 13 Oct 2017 00:18:58 +0000 (00:18 +0000)
I don't know if we ever hit this case or not. Turning it into an assert only fired on expanding some atomic operation in a SystemZ lit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315648 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 744f5c5..0d99998 100644 (file)
@@ -1027,7 +1027,7 @@ SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
   assert(!VT.isVector() &&
          "getZeroExtendInReg should use the vector element type instead of "
          "the vector type!");
-  if (Op.getValueType() == VT) return Op;
+  if (Op.getValueType().getScalarType() == VT) return Op;
   unsigned BitWidth = Op.getScalarValueSizeInBits();
   APInt Imm = APInt::getLowBitsSet(BitWidth,
                                    VT.getSizeInBits());