Skip to content

Commit 9094137

Browse files
committed
Fixing the build
1 parent d45d85c commit 9094137

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
12791279
ConstantInt *i =
12801280
mdconst::extract<ConstantInt>(MMO.getRanges()->getOperand(0));
12811281
if (i->getIntegerType()->getBitWidth() !=
1282-
MMO.getMemoryType().getScalarSizeInBits()) {
1282+
ValTy.getScalarType().getSizeInBits()) {
12831283
report("range is incompatible with the result type", MI);
12841284
}
12851285
}

llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-memory-metadata.mir

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
!0 = !{i24 0, i24 1048575}
3131
!1 = !{!"omnipotent char", !2}
3232
!2 = !{!"Simple C/C++ TBAA"}
33+
!3 = !{i32 0, i32 1048575}
3334
...
3435

3536
# Make sure range metadata is not preserved when widening loads, but
@@ -67,7 +68,7 @@ body: |
6768
; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), !tbaa !1, addrspace 1)
6869
; SI-NEXT: $vgpr0 = COPY [[LOAD]](s32)
6970
%0:_(p1) = COPY $vgpr0_vgpr1
70-
%1:_(s32) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !range !0, !tbaa !1)
71+
%1:_(s32) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !range !3, !tbaa !1)
7172
$vgpr0 = COPY %1
7273
7374
...

llvm/test/MachineVerifier/test_g_incompatible_range.mir

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RUN: not --crash llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=none %s -filetype=null 2>&1 | FileCheck %s
1+
# RUN: not --crash llc -o - -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=none %s 2>&1 | FileCheck %s
22
--- |
33
define void @mismatched_range_type() {
44
ret void
@@ -21,10 +21,8 @@ body: |
2121
; CHECK: Bad machine code: range is incompatible with the result type
2222
%3:_(<2 x s32>) = G_LOAD %0(p1) :: (volatile load (s64), align 4, !range !0, addrspace 1)
2323
24-
; CHECK: Bad machine code: range is incompatible with the result type
2524
%4:_(p0) = G_LOAD %0(p1) :: (volatile load (s64), align 4, !range !0, addrspace 1)
2625
27-
; CHECK: Bad machine code: range is incompatible with the result type
2826
%5:_(<2 x p0>) = G_LOAD %0(p1) :: (volatile load (s64), align 4, !range !0, addrspace 1)
2927
3028
$vgpr0_vgpr1 = COPY %3

0 commit comments

Comments
 (0)