From: Petar Avramovic Date: Tue, 27 Apr 2021 12:40:26 +0000 (+0200) Subject: AMDGPU/GlobalISel: Add test for buffer_load with negative offset X-Git-Tag: llvmorg-14-init~8334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a3e1b3531c08db59e2864b3c46a2e4303505f8e;p=platform%2Fupstream%2Fllvm.git AMDGPU/GlobalISel: Add test for buffer_load with negative offset Pre-commit test for D91336. --- diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.mir b/llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.mir index d6a3958..8fa4d34 100644 --- a/llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.mir +++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.mir @@ -46,3 +46,40 @@ body: | S_ENDPGM 0, implicit %4 ... + +--- +name: s_buffer_load_negative_offset +legalized: true +tracksRegLiveness: true +body: | + bb.0: + liveins: $sgpr0_sgpr1_sgpr2_sgpr3, $vgpr0 + + ; FAST-LABEL: name: s_buffer_load_negative_offset + ; FAST: liveins: $sgpr0_sgpr1_sgpr2_sgpr3, $vgpr0 + ; FAST: [[COPY:%[0-9]+]]:sgpr(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3 + ; FAST: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0 + ; FAST: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -60 + ; FAST: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32) + ; FAST: [[ADD:%[0-9]+]]:vgpr(s32) = G_ADD [[COPY1]], [[COPY2]] + ; FAST: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0 + ; FAST: [[AMDGPU_BUFFER_LOAD:%[0-9]+]]:vgpr(s32) = G_AMDGPU_BUFFER_LOAD [[COPY]](<4 x s32>), [[C1]](s32), [[COPY1]], [[C]], 0, 0, 0 :: (dereferenceable invariant load 4) + ; FAST: S_ENDPGM 0, implicit [[AMDGPU_BUFFER_LOAD]](s32) + ; GREEDY-LABEL: name: s_buffer_load_negative_offset + ; GREEDY: liveins: $sgpr0_sgpr1_sgpr2_sgpr3, $vgpr0 + ; GREEDY: [[COPY:%[0-9]+]]:sgpr(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3 + ; GREEDY: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0 + ; GREEDY: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -60 + ; GREEDY: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32) + ; GREEDY: [[ADD:%[0-9]+]]:vgpr(s32) = G_ADD [[COPY1]], [[COPY2]] + ; GREEDY: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0 + ; GREEDY: [[AMDGPU_BUFFER_LOAD:%[0-9]+]]:vgpr(s32) = G_AMDGPU_BUFFER_LOAD [[COPY]](<4 x s32>), [[C1]](s32), [[COPY1]], [[C]], 0, 0, 0 :: (dereferenceable invariant load 4) + ; GREEDY: S_ENDPGM 0, implicit [[AMDGPU_BUFFER_LOAD]](s32) + %0:_(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3 + %1:_(s32) = COPY $vgpr0 + %2:_(s32) = G_CONSTANT i32 -60 + %3:_(s32) = G_ADD %1, %2 + %4:_(s32) = G_AMDGPU_S_BUFFER_LOAD %0, %3, 0 + S_ENDPGM 0, implicit %4 + +...