Skip to content

Commit 2becfc6

Browse files
committed
Revert "Change MulImm to std::optional<int64_t> (NFC)"
This reverts commit 07d5584.
1 parent 07d5584 commit 2becfc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7380,7 +7380,7 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N,
73807380
return false;
73817381

73827382
SDValue VScale = N.getOperand(1);
7383-
std::optional<int64_t> MulImm;
7383+
int64_t MulImm = std::numeric_limits<int64_t>::max();
73847384
if (VScale.getOpcode() == ISD::VSCALE) {
73857385
MulImm = cast<ConstantSDNode>(VScale.getOperand(0))->getSExtValue();
73867386
} else if (auto C = dyn_cast<ConstantSDNode>(VScale)) {
@@ -7396,15 +7396,16 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N,
73967396
} else
73977397
return false;
73987398

7399-
assert(MulImm && "Uninitialized MulImm.");
7399+
assert(MulImm != std::numeric_limits<int64_t>::max() &&
7400+
"Uninitialized MulImm.");
74007401

74017402
TypeSize TS = MemVT.getSizeInBits();
74027403
int64_t MemWidthBytes = static_cast<int64_t>(TS.getKnownMinValue()) / 8;
74037404

7404-
if ((*MulImm % MemWidthBytes) != 0)
7405+
if ((MulImm % MemWidthBytes) != 0)
74057406
return false;
74067407

7407-
int64_t Offset = *MulImm / MemWidthBytes;
7408+
int64_t Offset = MulImm / MemWidthBytes;
74087409
if (Offset < Min || Offset > Max)
74097410
return false;
74107411

0 commit comments

Comments
 (0)