[CodeGen] Fix bug in IncrementPointer

In an earlier patch I meant to add the correct flags to the ADD
node when incrementing the pointer, but forgot to pass them to
SelectionDAG::getNode.

Differential Revision: https://reviews.llvm.org/D87496
This commit is contained in:
David Sherwood 2020-09-10 11:54:58 +01:00
parent cdacffe4ac
commit 15bff4dec4
1 changed files with 2 additions and 1 deletions

View File

@ -1006,7 +1006,8 @@ void DAGTypeLegalizer::IncrementPointer(MemSDNode *N, EVT MemVT,
Flags.setNoUnsignedWrap(true); Flags.setNoUnsignedWrap(true);
if (ScaledOffset) if (ScaledOffset)
*ScaledOffset += IncrementSize; *ScaledOffset += IncrementSize;
Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, BytesIncrement); Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, BytesIncrement,
Flags);
} else { } else {
MPI = N->getPointerInfo().getWithOffset(IncrementSize); MPI = N->getPointerInfo().getWithOffset(IncrementSize);
// Increment the pointer to the other half. // Increment the pointer to the other half.