Skip to content

Commit b1bd621

Browse files
committed
MMO can be scalable vector type so we use TypeSize isKnownGT to compare load memory size with result size
1 parent cedcff8 commit b1bd621

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
11921192
if (MMO.getSizeInBits() >= ValTy.getSizeInBits())
11931193
report("Generic extload must have a narrower memory type", MI);
11941194
} else if (MI->getOpcode() == TargetOpcode::G_LOAD) {
1195-
if (MMO.getSize() > ValTy.getSizeInBytes())
1195+
if (TypeSize::isKnownGT(MMO.getMemoryType().getSizeInBytes(), ValTy.getSizeInBytes()))
11961196
report("load memory size cannot exceed result size", MI);
11971197
} else if (MI->getOpcode() == TargetOpcode::G_STORE) {
11981198
if (ValTy.getSizeInBytes() < MMO.getSize())

0 commit comments

Comments
 (0)