Skip to content

Commit 66561eb

Browse files
michaelmaitlandtmsri
authored andcommitted
[MachineVerifier] Fix bug in MachineVerifier for G_INSERT_SUBVECTOR (llvm#109048)
1 parent ab51fcc commit 66561eb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
17391739
}
17401740

17411741
if (IndexOp.getImm() != 0 &&
1742-
Src1Ty.getElementCount().getKnownMinValue() % IndexOp.getImm() != 0) {
1742+
IndexOp.getImm() % Src1Ty.getElementCount().getKnownMinValue() != 0) {
17431743
report("Index must be a multiple of the second source vector's "
17441744
"minimum vector length",
17451745
MI);

llvm/test/MachineVerifier/test_g_insert_subvector.mir

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ body: |
4141
4242
; CHECK: Index must be a multiple of the second source vector's minimum vector length
4343
%13:_(<vscale x 4 x s32>) = G_INSERT_SUBVECTOR %12, %1, 3
44+
45+
; CHECK: Index must be a multiple of the second source vector's minimum vector length
46+
%13:_(<vscale x 4 x s32>) = G_INSERT_SUBVECTOR %12, %1, 1
4447
...

0 commit comments

Comments
 (0)