xref: /llvm-project/llvm/test/CodeGen/AMDGPU/adjust-writemask-cse.ll (revision b3995aa338a2837626d31ae8fffc340d95b888ca)
18669a9f9SJay Foad; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
29e9907f1SFangrui Song; RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -stop-after=finalize-isel < %s | FileCheck %s -check-prefix=GFX10
38669a9f9SJay Foad
48669a9f9SJay Foaddefine float @test() {
58669a9f9SJay Foad  ; GFX10-LABEL: name: test
68669a9f9SJay Foad  ; GFX10: bb.0.bb:
78669a9f9SJay Foad  ; GFX10-NEXT:   [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
88669a9f9SJay Foad  ; GFX10-NEXT:   [[REG_SEQUENCE:%[0-9]+]]:sgpr_256 = REG_SEQUENCE [[S_MOV_B32_]], %subreg.sub0, [[S_MOV_B32_]], %subreg.sub1, [[S_MOV_B32_]], %subreg.sub2, [[S_MOV_B32_]], %subreg.sub3, [[S_MOV_B32_]], %subreg.sub4, [[S_MOV_B32_]], %subreg.sub5, [[S_MOV_B32_]], %subreg.sub6, [[S_MOV_B32_]], %subreg.sub7
9*b3995aa3SJay Foad  ; GFX10-NEXT:   [[COPY:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
10*b3995aa3SJay Foad  ; GFX10-NEXT:   [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
11*b3995aa3SJay Foad  ; GFX10-NEXT:   [[IMAGE_LOAD_V2_V2_nsa_gfx10_:%[0-9]+]]:vreg_64 = IMAGE_LOAD_V2_V2_nsa_gfx10 [[COPY]], [[COPY1]], killed [[REG_SEQUENCE]], 3, 1, -1, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load (s96), align 16, addrspace 8)
12*b3995aa3SJay Foad  ; GFX10-NEXT:   [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[IMAGE_LOAD_V2_V2_nsa_gfx10_]].sub1
13*b3995aa3SJay Foad  ; GFX10-NEXT:   [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[IMAGE_LOAD_V2_V2_nsa_gfx10_]].sub0
148669a9f9SJay Foad  ; GFX10-NEXT:   [[V_ADD_F32_e64_:%[0-9]+]]:vgpr_32 = nofpexcept V_ADD_F32_e64 0, [[COPY2]], 0, killed [[COPY3]], 0, 0, implicit $mode, implicit $exec
158669a9f9SJay Foad  ; GFX10-NEXT:   [[V_ADD_F32_e64_1:%[0-9]+]]:vgpr_32 = nofpexcept V_ADD_F32_e64 0, killed [[V_ADD_F32_e64_]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
168669a9f9SJay Foad  ; GFX10-NEXT:   $vgpr0 = COPY [[V_ADD_F32_e64_1]]
178669a9f9SJay Foad  ; GFX10-NEXT:   SI_RETURN implicit $vgpr0
188669a9f9SJay Foadbb:
198669a9f9SJay Foad  %v0 = call <2 x float> @llvm.amdgcn.image.load.2d.v2f32.i32(i32 3, i32 0, i32 0, <8 x i32> zeroinitializer, i32 0, i32 0)
208669a9f9SJay Foad  %v1 = call <3 x float> @llvm.amdgcn.image.load.2d.v3f32.i32(i32 7, i32 0, i32 0, <8 x i32> zeroinitializer, i32 0, i32 0)
218669a9f9SJay Foad  %e0 = extractelement <2 x float> %v0, i64 1
228669a9f9SJay Foad  %e1 = extractelement <3 x float> %v1, i64 0
238669a9f9SJay Foad  %e2 = extractelement <3 x float> %v1, i64 1
248669a9f9SJay Foad  %a0 = fadd float %e0, %e1
258669a9f9SJay Foad  %a1 = fadd float %a0, %e2
268669a9f9SJay Foad  ret float %a1
278669a9f9SJay Foad}
288669a9f9SJay Foad
298669a9f9SJay Foaddeclare <3 x float> @llvm.amdgcn.image.load.2d.v3f32.i32(i32 immarg, i32, i32, <8 x i32>, i32 immarg, i32 immarg)
308669a9f9SJay Foaddeclare <2 x float> @llvm.amdgcn.image.load.2d.v2f32.i32(i32 immarg, i32, i32, <8 x i32>, i32 immarg, i32 immarg)
31