Skip to content

Commit 418bd54

Browse files
committed
Address comments
1 parent cd141bb commit 418bd54

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4389,13 +4389,11 @@ void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
43894389
SDNodeFlags ScaleFlags;
43904390
// The multiplication of an index by the type size does not wrap the
43914391
// pointer index type in a signed sense (mul nsw).
4392-
if (NW.hasNoUnsignedSignedWrap())
4393-
ScaleFlags.setNoSignedWrap(true);
4392+
ScaleFlags.setNoSignedWrap(NW.hasNoUnsignedSignedWrap());
43944393

43954394
// The multiplication of an index by the type size does not wrap the
43964395
// pointer index type in an unsigned sense (mul nuw).
4397-
if (NW.hasNoUnsignedWrap())
4398-
ScaleFlags.setNoUnsignedWrap(true);
4396+
ScaleFlags.setNoUnsignedWrap(NW.hasNoUnsignedWrap());
43994397

44004398
if (ElementScalable) {
44014399
EVT VScaleTy = N.getValueType().getScalarType();
@@ -4424,14 +4422,12 @@ void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
44244422
}
44254423
}
44264424

4427-
SDNodeFlags AddFlags;
4428-
44294425
// The successive addition of the current address, truncated to the
44304426
// pointer index type and interpreted as an unsigned number, and each
44314427
// offset, also interpreted as an unsigned number, does not wrap the
44324428
// pointer index type (add nuw).
4433-
if (NW.hasNoUnsignedWrap())
4434-
AddFlags.setNoUnsignedWrap(true);
4429+
SDNodeFlags AddFlags;
4430+
AddFlags.setNoUnsignedWrap(NW.hasNoUnsignedWrap());
44354431

44364432
N = DAG.getNode(ISD::ADD, dl, N.getValueType(), N, IdxN, AddFlags);
44374433
}

0 commit comments

Comments
 (0)