@@ -4389,13 +4389,11 @@ void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
4389
4389
SDNodeFlags ScaleFlags;
4390
4390
// The multiplication of an index by the type size does not wrap the
4391
4391
// pointer index type in a signed sense (mul nsw).
4392
- if (NW.hasNoUnsignedSignedWrap ())
4393
- ScaleFlags.setNoSignedWrap (true );
4392
+ ScaleFlags.setNoSignedWrap (NW.hasNoUnsignedSignedWrap ());
4394
4393
4395
4394
// The multiplication of an index by the type size does not wrap the
4396
4395
// pointer index type in an unsigned sense (mul nuw).
4397
- if (NW.hasNoUnsignedWrap ())
4398
- ScaleFlags.setNoUnsignedWrap (true );
4396
+ ScaleFlags.setNoUnsignedWrap (NW.hasNoUnsignedWrap ());
4399
4397
4400
4398
if (ElementScalable) {
4401
4399
EVT VScaleTy = N.getValueType ().getScalarType ();
@@ -4424,14 +4422,12 @@ void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
4424
4422
}
4425
4423
}
4426
4424
4427
- SDNodeFlags AddFlags;
4428
-
4429
4425
// The successive addition of the current address, truncated to the
4430
4426
// pointer index type and interpreted as an unsigned number, and each
4431
4427
// offset, also interpreted as an unsigned number, does not wrap the
4432
4428
// pointer index type (add nuw).
4433
- if (NW. hasNoUnsignedWrap ())
4434
- AddFlags.setNoUnsignedWrap (true );
4429
+ SDNodeFlags AddFlags;
4430
+ AddFlags.setNoUnsignedWrap (NW. hasNoUnsignedWrap () );
4435
4431
4436
4432
N = DAG.getNode (ISD::ADD, dl, N.getValueType (), N, IdxN, AddFlags);
4437
4433
}
0 commit comments