Skip to content

Commit a38d5e0

Browse files
authored
[SelectionDAG] Use LAST_INTEGER_VALUETYPE instead of i64 (llvm#98299)
When looking for a largest legal integer type for a target `TargetLowering::findOptimalMemOpLowering` assumes that `MVT::i64` is the largets possible integer type. The patch removes this assumption and uses `MVT::LAST_INTEGER_VALUETYPE` instead.
1 parent 88e9c56 commit a38d5e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ bool TargetLowering::findOptimalMemOpLowering(
209209
// Use the largest integer type whose alignment constraints are satisfied.
210210
// We only need to check DstAlign here as SrcAlign is always greater or
211211
// equal to DstAlign (or zero).
212-
VT = MVT::i64;
212+
VT = MVT::LAST_INTEGER_VALUETYPE;
213213
if (Op.isFixedDstAlign())
214214
while (Op.getDstAlign() < (VT.getSizeInBits() / 8) &&
215215
!allowsMisalignedMemoryAccesses(VT, DstAS, Op.getDstAlign()))
216216
VT = (MVT::SimpleValueType)(VT.getSimpleVT().SimpleTy - 1);
217217
assert(VT.isInteger());
218218

219219
// Find the largest legal integer type.
220-
MVT LVT = MVT::i64;
220+
MVT LVT = MVT::LAST_INTEGER_VALUETYPE;
221221
while (!isTypeLegal(LVT))
222222
LVT = (MVT::SimpleValueType)(LVT.SimpleTy - 1);
223223
assert(LVT.isInteger());

0 commit comments

Comments
 (0)