Skip to content

Commit 4c23ee1

Browse files
committed
[AMDGPU] Add isAsCheapAsAMove for v_pk_mov_b32
1 parent 3feb6ee commit 4c23ee1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

llvm/lib/Target/AMDGPU/VOP3PInstructions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ let isCommutable = 1, isReMaterializable = 1 in {
11511151
defm V_PK_ADD_F32 : VOP3PInst<"v_pk_add_f32", VOP3P_Profile<VOP_V2F32_V2F32_V2F32, VOP3_PACKED>, any_fadd>;
11521152
} // End SubtargetPredicate = HasPackedFP32Ops
11531153

1154-
let SubtargetPredicate = HasPkMovB32 in
1154+
let SubtargetPredicate = HasPkMovB32, isAsCheapAsAMove = 1 in
11551155
defm V_PK_MOV_B32 : VOP3PInst<"v_pk_mov_b32", VOP3P_Profile<VOP_V2I32_V2I32_V2I32, VOP3_PACKED>>;
11561156
} // End isCommutable = 1, isReMaterializable = 1
11571157

llvm/test/CodeGen/AMDGPU/vgpr-remat.mir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ body: |
5757
; CHECK-NEXT: liveins: $sgpr0
5858
; CHECK-NEXT: {{ $}}
5959
; CHECK-NEXT: [[V_PK_MOV_B32_:%[0-9]+]]:vreg_64_align2 = V_PK_MOV_B32 8, 0, 8, 0, 0, 0, 0, 0, 0, implicit $exec
60-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_64_align2 = COPY [[V_PK_MOV_B32_]]
61-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = COPY [[V_PK_MOV_B32_]]
62-
; CHECK-NEXT: [[COPY2:%[0-9]+]]:sreg_64 = COPY $sgpr0
63-
; CHECK-NEXT: $exec = S_MOV_B64_term [[COPY2]]
60+
; CHECK-NEXT: [[V_PK_MOV_B32_1:%[0-9]+]]:vreg_64_align2 = V_PK_MOV_B32 8, 0, 8, 0, 0, 0, 0, 0, 0, implicit $exec
61+
; CHECK-NEXT: [[V_PK_MOV_B32_2:%[0-9]+]]:vreg_64_align2 = V_PK_MOV_B32 8, 0, 8, 0, 0, 0, 0, 0, 0, implicit $exec
62+
; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0
63+
; CHECK-NEXT: $exec = S_MOV_B64_term [[COPY]]
6464
; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
6565
; CHECK-NEXT: S_BRANCH %bb.1
6666
; CHECK-NEXT: {{ $}}
6767
; CHECK-NEXT: bb.1:
6868
; CHECK-NEXT: successors: %bb.2(0x80000000)
6969
; CHECK-NEXT: {{ $}}
70-
; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[COPY]], 8, [[COPY]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
71-
; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[COPY1]], 8, [[COPY1]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
70+
; CHECK-NEXT: [[V_PK_MOV_B32_1:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[V_PK_MOV_B32_1]], 8, [[V_PK_MOV_B32_1]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
71+
; CHECK-NEXT: [[V_PK_MOV_B32_2:%[0-9]+]]:vreg_64_align2 = V_PK_ADD_F32 8, [[V_PK_MOV_B32_2]], 8, [[V_PK_MOV_B32_2]], 11, 0, 0, 0, 0, implicit $mode, implicit $exec
7272
; CHECK-NEXT: {{ $}}
7373
; CHECK-NEXT: bb.2:
74-
; CHECK-NEXT: S_NOP 0, implicit [[COPY]]
75-
; CHECK-NEXT: S_NOP 0, implicit [[COPY1]]
74+
; CHECK-NEXT: S_NOP 0, implicit [[V_PK_MOV_B32_1]]
75+
; CHECK-NEXT: S_NOP 0, implicit [[V_PK_MOV_B32_2]]
7676
; CHECK-NEXT: S_ENDPGM 0, implicit [[V_PK_MOV_B32_]]
7777
bb.0:
7878
liveins: $sgpr0

0 commit comments

Comments
 (0)