2020-01-19 05:51:43 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2020-02-18 07:16:59 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=gfx600 -amdgpu-bypass-slow-div=0 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=gfx600 -amdgpu-bypass-slow-div=0 -amdgpu-codegenprepare-expand-div64 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN-IR %s
|
2020-01-19 05:51:43 +08:00
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem:
|
|
|
|
; GCN: ; %bb.0:
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx2 s[12:13], s[0:1], 0xd
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x9
|
|
|
|
; GCN-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s6, -1
|
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v0, s12
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v1, s13
|
|
|
|
; GCN-NEXT: s_sub_u32 s2, 0, s12
|
|
|
|
; GCN-NEXT: s_subb_u32 s3, 0, s13
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s4, s8
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0x4f800000, v1
|
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v0, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s5, s9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v0, 0x5f7ffffc, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v1, 0x2f800000, v0
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0xcf800000, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v0, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, s2, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, s2, v1
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s3, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, s2, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, v0, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, v1, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v1, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v1, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, 0, v7, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v1, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v4, v3
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v5, v6, vcc
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v4, 0
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v8, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v6, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v0, s[0:1], v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v6, v5, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v2, vcc, v1, v3, s[0:1]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, s2, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, s3, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v7, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, s2, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v8, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v0, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v12, v0, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v11, v0, v7
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v2, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v11, v10
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v11, vcc, 0, v12, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v2, v5
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v10, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v11, v9, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v8, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v7, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v6, v5, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v1, vcc, v1, v5, s[0:1]
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, s10, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, s10, v0
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, s10, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, s11, v1
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, s11, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v5, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s11, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v0, s11, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v5, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v0, vcc, v3, v0, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v2, vcc, v7, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v1
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v6, v2, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, s12, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v2, s12, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v3, s13, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, s12, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v0, s[0:1], s10, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v2, vcc, s11, v1
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v3, s13
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[0:1]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e64 v4, s[2:3], s12, v0
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v5, vcc, 0, v2, s[2:3]
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s13, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s12, v4
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s13, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[2:3]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e32 v3, vcc, s12, v4
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e32 v2, vcc, 0, v2, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[2:3], 0, v6
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v5, v2, s[2:3]
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v5, s11
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v1, vcc, v5, v1, s[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s13, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s12, v0
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s13, v1
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v5, v5, v6, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v1, v2, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v4, v3, s[2:3]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[2:3], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[10:11], s[6:7], 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[8:9], s[0:1], 0
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s12, s0
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s14, s12, 32
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[12:13], s[8:9], s[10:11]
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s8, s1
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s1, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s10, s14, s8
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s8, s6
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s8, s8, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s9, s7
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s7, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s14, s8, s9
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s8, s10, s14
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s9, 0, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_gt_u64_e64 s[16:17], s[8:9], 63
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s11, 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[12:13], s[12:13], s[16:17]
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e64 s[16:17], s[8:9], 63
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[18:19], s[12:13], -1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[16:17], s[18:19], s[16:17]
|
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, s[16:17]
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB0_5
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s16, s8, 1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s8
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s17, s9, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s9
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[16:17], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_i32 s8, 63, s8
|
|
|
|
; GCN-IR-NEXT: s_andn2_b64 vcc, exec, vcc
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[12:13], s[6:7], s8
|
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB0_4
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b64 s[16:17], s[6:7], s16
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s8, s0, -1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s9, s1, -1
|
|
|
|
; GCN-IR-NEXT: s_not_b64 s[2:3], s[10:11]
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s15, s11
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s10, s2, s14
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s11, s3, s11
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[14:15], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: BB0_3: ; %udiv-do-while
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b32 s2, s13, 31
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[16:17], s[16:17], 1
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[12:13], s[12:13], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[16:17], s[16:17], s[2:3]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[12:13], s[14:15], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s2, s8, s16
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s2, s9, s17
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s14, s2, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s15, s14
|
|
|
|
; GCN-IR-NEXT: s_and_b32 s2, s14, 1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[18:19], s[14:15], s[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s16, s16, s18
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s10
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s17, s17, s19
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s11
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s10, s10, 1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s11, s11, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[10:11], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[14:15], s[2:3]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB0_3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: BB0_4: ; %Flow6
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[8:9], s[12:13], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[2:3], s[2:3], s[8:9]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s2
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s3
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_branch BB0_6
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: BB0_5:
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s7
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v1, v0, 0, s[12:13]
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s6
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v0, v0, 0, s[12:13]
|
|
|
|
; GCN-IR-NEXT: BB0_6: ; %udiv-end
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, s0, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v2, s0, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, s1, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, s0, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, s7
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v2, v1, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s6, -1
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = urem i64 %x, %y
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem(i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: v_test_srem:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v4, 31, v3
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v2, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v3, v4, vcc
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v3, v3, v4
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v2, v2, v4
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v4, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v5, v3
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v6, vcc, 0, v2
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v7, vcc, 0, v3, vcc
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v14, 0
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v4, 0x4f800000, v5
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v4, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v13, 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v4, 0x5f7ffffc, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v5, 0x2f800000, v4
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v5, v5
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v4, 0xcf800000, v5
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v4, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v5, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v6, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v9, v6, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v7, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v8, vcc, v8, v9
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v9, v6, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v8, vcc, v8, v10
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v11, v4, v8
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v10, v4, v8
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v12, v4, v9
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v15, v5, v8
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v5, v8
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v11, vcc, v12, v11
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v12, v5, v9
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v5, v9
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v10, vcc, v14, v10, vcc
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v11, vcc, v11, v12
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v9, vcc, v10, v9, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v10, vcc, v15, v13, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v8, vcc, v9, v8
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v4, s[4:5], v4, v8
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v9, vcc, v14, v10, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v8, vcc, v5, v9, s[4:5]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v6, v8
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v11, v6, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v7, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, v6, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v11, v10
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v10, v7
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v12, v4, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v15, v4, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v16, v4, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v11, v8, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, v8, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v12, vcc, v15, v12
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v10, v8, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v15, vcc, v14, v16, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v8, v7
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v12, v6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v15, v11, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v10, v13, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v6, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v14, v8, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v5, v9
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v5, vcc, v5, v7, s[4:5]
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v6
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, 0, v5, vcc
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v6, 31, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v6
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v0, v0, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v0, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v0, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v0, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v1, v6, vcc
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v1, v1, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v8, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v14, v9, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v9, v1, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v4, v1, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v10, v1, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v1, v5
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v7, v9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v4, vcc, v8, v4, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v10, v13, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v14, v7, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, v2, v4
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v3, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v2, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v7, v5
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v5, v8
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v7, vcc, v1, v5
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v7, v3, vcc
|
|
|
|
; GCN-NEXT: v_sub_i32_e64 v7, s[4:5], v0, v2
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v8, s[6:7], 0, v4, s[4:5]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v8, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e32 v1, vcc, v1, v5, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v9, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v7, v2
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v10, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e64 s[6:7], v8, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v1, v3
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v4, v3, s[4:5]
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v9, v9, v10, s[6:7]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v10, s[4:5], v7, v2
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v0, v2
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v4, s[4:5], 0, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, 0, -1, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, v1, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v2, v5, v2, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[4:5], 0, v9
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v2
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v7, v10, s[4:5]
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v4, v8, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v1, v4, vcc
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v0, v0, v6
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v1, v1, v6
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v6
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v1, vcc, v1, v6, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v4, 31, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v6, 31, v3
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v4
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v4, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v2, v2, v6
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v5, vcc, v2, v6
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v3, v3, v6
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v6, vcc, v3, v6, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e32 vcc, 0, v[5:6]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[4:5], 0, v[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v3, v5
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[6:7], vcc, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, 32, v3
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v7, v6
|
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u32_e32 vcc, 0, v6
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v12, v7, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v3, v0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, 32, v3
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v7, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v14, v7, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v7, vcc, v12, v14
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v8, s[4:5], 0, 0, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, 63, v[7:8]
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e64 s[4:5], 63, v[7:8]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[6:7], s[6:7], vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[8:9], s[6:7], -1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, v4
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v15, v13
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v3, v1, 0, s[6:7]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 s[4:5], s[8:9], s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v9, v0, 0, s[6:7]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[6:7], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB1_6
|
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v9, vcc, 1, v7
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v10, vcc, 0, v8, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v3, s[4:5], 63, v7
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_u64_e32 vcc, v[9:10], v[7:8]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v10, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[7:8], v[0:1], v3
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v11, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[4:5], vcc
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[10:11], exec, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB1_5
|
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, -1, v5
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshr_b64 v[16:17], v[0:1], v9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v9, vcc, -1, v6, vcc
|
|
|
|
; GCN-IR-NEXT: v_not_b32_e32 v10, v12
|
|
|
|
; GCN-IR-NEXT: v_not_b32_e32 v11, v13
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v12, vcc, v10, v14
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v13, vcc, v11, v15, vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v14, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v15, 0
|
|
|
|
; GCN-IR-NEXT: BB1_3: ; %udiv-do-while
|
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[16:17], v[16:17], 1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshrrev_b32_e32 v10, 31, v8
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v16, v16, v10
|
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[7:8], v[7:8], 1
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v10, vcc, v3, v16
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v10, vcc, v9, v17, vcc
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v7, v14, v7
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v14, 31, v10
|
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v19, v14, v5
|
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v10, 1, v14
|
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v18, v14, v6
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v14, vcc, 1, v12
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v8, v15, v8
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v15, vcc, 0, v13, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, v[14:15], v[12:13]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, v14
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v11, 0
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v16, s[4:5], v16, v19
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, v15
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v15, v11
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v17, s[4:5], v17, v18, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], vcc, s[8:9]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v14, v10
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_andn2_b64 exec, exec, s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execnz BB1_3
|
|
|
|
; GCN-IR-NEXT: ; %bb.4: ; %Flow
|
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[8:9]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB1_5: ; %Flow3
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[10:11]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[7:8], v[7:8], 1
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v3, v11, v8
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v9, v10, v7
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB1_6: ; %Flow4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[6:7]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, v5, v3
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v7, v5, v9
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v6, v6, v9
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v5, v5, v9
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, v7, v3
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, v3, v6
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v5
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = srem i64 %x, %y
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem23_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem23_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[6:7], s[6:7], 41
|
|
|
|
; GCN-NEXT: s_ashr_i64 s[0:1], s[0:1], 41
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 23
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem23_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[6:7], s[6:7], 41
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[0:1], s[0:1], 41
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 23
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 41
|
|
|
|
%2 = ashr i64 %y, 41
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem24_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem24_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[6:7], s[6:7], 40
|
|
|
|
; GCN-NEXT: s_ashr_i64 s[0:1], s[0:1], 40
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem24_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[6:7], s[6:7], 40
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[0:1], s[0:1], 40
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 40
|
|
|
|
%2 = ashr i64 %y, 40
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem24_64(i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: v_test_srem24_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_ashr_i64 v[2:3], v[2:3], 40
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v3, v2
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v5, v0, v2
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v5, 30, v5
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v4, v3
|
|
|
|
; GCN-NEXT: v_or_b32_e32 v5, 1, v5
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v4, v1, v4
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v4, v4
|
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v4, v3, v1
|
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v4, v4
|
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v3|
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, 0, v5, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v4, v1
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, v1, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
|
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem24_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_ashr_i64 v[2:3], v[2:3], 40
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v3, v2
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v5, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v5, 30, v5
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v4, v3
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v5, 1, v5
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v4, v1, v4
|
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v4, v4
|
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v4, v3, v1
|
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v4, v4
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, |v3|
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v1, 0, v5, vcc
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v4, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
|
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 40
|
|
|
|
%2 = ashr i64 %y, 40
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem25_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem25_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[6:7], s[6:7], 39
|
|
|
|
; GCN-NEXT: s_ashr_i64 s[0:1], s[0:1], 39
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 25
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem25_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[6:7], s[6:7], 39
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[0:1], s[0:1], 39
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 25
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 39
|
|
|
|
%2 = ashr i64 %y, 39
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem31_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem31_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[6:7], s[6:7], 33
|
|
|
|
; GCN-NEXT: s_ashr_i64 s[0:1], s[0:1], 33
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 31
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem31_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s1, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[6:7], s[6:7], 33
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[0:1], s[0:1], 33
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b32 s1, s6, s0
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s1, s1, 30
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s1, s1, 1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[8:9], |v1|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s8, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s1, s1, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s1, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 31
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 33
|
|
|
|
%2 = ashr i64 %y, 33
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; 32 known sign bits
|
|
|
|
define amdgpu_kernel void @s_test_srem32_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem32_64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GCN-NEXT: s_load_dword s6, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, s7
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s6
|
|
|
|
; GCN-NEXT: s_xor_b32 s0, s7, s6
|
|
|
|
; GCN-NEXT: s_ashr_i32 s0, s0, 30
|
|
|
|
; GCN-NEXT: s_or_b32 s8, s0, 1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[0:1], |v1|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s0, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s0, s8, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s7, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem32_64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: s_load_dword s6, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, s7
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s6
|
|
|
|
; GCN-IR-NEXT: s_xor_b32 s0, s7, s6
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s0, s0, 30
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s8, s0, 1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v2, v0, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[0:1], |v1|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s0, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s0, s8, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s0, v2
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s7, v0
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 32
|
|
|
|
%2 = ashr i64 %y, 32
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; 33 known sign bits
|
|
|
|
define amdgpu_kernel void @s_test_srem33_64(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem33_64:
|
|
|
|
; GCN: ; %bb.0:
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s11, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s10, -1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[2:3], s[6:7], 31
|
|
|
|
; GCN-NEXT: s_ashr_i64 s[8:9], s[0:1], 31
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i32 s0, s1, 31
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_add_u32 s8, s8, s0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, s0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_addc_u32 s9, s9, s0
|
|
|
|
; GCN-NEXT: s_xor_b64 s[12:13], s[8:9], s[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v0, s12
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v1, s13
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_sub_u32 s6, 0, s12
|
|
|
|
; GCN-NEXT: s_subb_u32 s8, 0, s13
|
|
|
|
; GCN-NEXT: s_mov_b32 s9, s5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0x4f800000, v1
|
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v0, v0
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v0, 0x5f7ffffc, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v1, 0x2f800000, v0
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0xcf800000, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v0, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, s6, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, s6, v1
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s8, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, s6, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, v0, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, v1, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v1, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, 0, v6, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, v1, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v4, v1, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v6, v3
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v5, v4, vcc
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v4, 0
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v7, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v6, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v0, s[0:1], v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v6, v5, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v2, vcc, v1, v3, s[0:1]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s6, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, s6, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, s8, v0
|
|
|
|
; GCN-NEXT: s_mov_b32 s8, s4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v7, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, s6, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v8, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v0, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v12, v0, v5
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v11, v0, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v2, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v11, v10
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v11, vcc, 0, v12, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v2, v5
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v10, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v11, v9, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v8, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v7, v2
|
|
|
|
; GCN-NEXT: s_ashr_i32 s6, s7, 31
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v6, v5, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v1, vcc, v1, v5, s[0:1]
|
|
|
|
; GCN-NEXT: s_add_u32 s0, s2, s6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: s_mov_b32 s7, s6
|
|
|
|
; GCN-NEXT: s_addc_u32 s1, s3, s6
|
|
|
|
; GCN-NEXT: s_xor_b64 s[14:15], s[0:1], s[6:7]
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, s14, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, s14, v0
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, s14, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, s15, v1
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, s15, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v5, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, s15, v0
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v0, s15, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v5, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v0, vcc, v3, v0, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v2, vcc, v7, v4, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v1
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v6, v2, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, s12, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v2, s12, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v3, s13, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, s12, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v0, s[0:1], s14, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v2, vcc, s15, v1
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v3, s13
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[0:1]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e64 v4, s[2:3], s12, v0
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v5, vcc, 0, v2, s[2:3]
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s13, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s12, v4
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s13, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[2:3]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e32 v3, vcc, s12, v4
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e32 v2, vcc, 0, v2, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[2:3], 0, v6
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v5, v2, s[2:3]
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v5, s15
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v1, vcc, v5, v1, s[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s13, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s12, v0
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s13, v1
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v5, v5, v6, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v1, v2, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v4, v3, s[2:3]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_xor_b32_e32 v0, s6, v0
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v1, s6, v1
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v2, s6
|
|
|
|
; GCN-NEXT: v_subrev_i32_e32 v0, vcc, s6, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[8:11], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem33_64:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[2:3], s[6:7], 31
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[8:9], s[0:1], 31
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s10, s1, 31
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s0, s7, 31
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s11, s10
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[6:7], s[8:9], s[10:11]
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[2:3], s[2:3], s[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s2, s2, s0
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s3, s3, s0
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s6, s6, s10
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s7, s7, s10
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[10:11], s[6:7], 0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[12:13], s[2:3], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[10:11], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s10, s6
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s10, s10, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s11, s7
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s7, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s12, s10, s11
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s10, s2
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s10, s10, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s11, s3
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s3, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s16, s10, s11
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s10, s12, s16
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s11, 0, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_gt_u64_e64 s[18:19], s[10:11], 63
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s13, 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[14:15], s[18:19]
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e64 s[18:19], s[10:11], 63
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[20:21], s[14:15], -1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[18:19], s[20:21], s[18:19]
|
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, s[18:19]
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB8_5
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s18, s10, 1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s10
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s19, s11, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s11
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[18:19], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_i32 s10, 63, s10
|
|
|
|
; GCN-IR-NEXT: s_andn2_b64 vcc, exec, vcc
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[14:15], s[2:3], s10
|
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB8_4
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b64 s[18:19], s[2:3], s18
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s10, s6, -1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s11, s7, -1
|
|
|
|
; GCN-IR-NEXT: s_not_b64 s[8:9], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s17, s13
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s12, s8, s16
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s13, s9, s13
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[16:17], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s9, 0
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: BB8_3: ; %udiv-do-while
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b32 s8, s15, 31
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[18:19], s[18:19], 1
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[14:15], s[14:15], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[18:19], s[18:19], s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[16:17], s[14:15]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s8, s10, s18
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s8, s11, s19
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s16, s8, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s17, s16
|
|
|
|
; GCN-IR-NEXT: s_and_b32 s8, s16, 1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[20:21], s[16:17], s[6:7]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s18, s18, s20
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s12
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s19, s19, s21
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s13
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s12, s12, 1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s13, s13, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[12:13], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[16:17], s[8:9]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB8_3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: BB8_4: ; %Flow6
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[10:11], s[14:15], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], s[8:9], s[10:11]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s8
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s9
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_branch BB8_6
|
|
|
|
; GCN-IR-NEXT: BB8_5:
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s3
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v1, v0, 0, s[14:15]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s2
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v0, v0, 0, s[14:15]
|
|
|
|
; GCN-IR-NEXT: BB8_6: ; %udiv-end
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, s6, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v2, s6, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, s7, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, s6, v0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s7, 0xf000
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s2, v0
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, s3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v2, v1, vcc
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, s0, v0
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, s1, v1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, s1
|
|
|
|
; GCN-IR-NEXT: v_subrev_i32_e32 v0, vcc, s0, v0
|
2020-04-06 17:56:11 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s6, -1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i64 %x, 31
|
|
|
|
%2 = ashr i64 %y, 31
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem24_48(i48 addrspace(1)* %out, i48 %x, i48 %y) {
|
|
|
|
; GCN-LABEL: s_test_srem24_48:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; GCN-NEXT: s_load_dword s2, s[0:1], 0xb
|
|
|
|
; GCN-NEXT: s_load_dword s3, s[0:1], 0xc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dword s6, s[0:1], 0xd
|
|
|
|
; GCN-NEXT: s_load_dword s0, s[0:1], 0xe
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v2, s2
|
|
|
|
; GCN-NEXT: s_sext_i32_i16 s1, s3
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v0, s6
|
|
|
|
; GCN-NEXT: s_sext_i32_i16 s0, s0
|
|
|
|
; GCN-NEXT: v_alignbit_b32 v0, s0, v0, 24
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_alignbit_b32 v2, s1, v2, 24
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v3, v2
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v5, v2, v0
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v4, v1
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v5, 30, v5
|
|
|
|
; GCN-NEXT: v_or_b32_e32 v5, 1, v5
|
|
|
|
; GCN-NEXT: s_mov_b32 s6, -1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v4, v3, v4
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v4, v4
|
|
|
|
; GCN-NEXT: v_mad_f32 v3, -v4, v1, v3
|
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v4, v4
|
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 vcc, |v3|, |v1|
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, 0, v5, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v4, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v1, v0
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v2, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; GCN-NEXT: buffer_store_short v1, off, s[4:7], 0 offset:4
|
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem24_48:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s2, s[0:1], 0xb
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s3, s[0:1], 0xc
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dword s6, s[0:1], 0xd
|
|
|
|
; GCN-IR-NEXT: s_load_dword s0, s[0:1], 0xe
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; GCN-IR-NEXT: s_sext_i32_i16 s3, s3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[8:9], s[2:3], 24
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: s_sext_i32_i16 s7, s0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s0, s3, 31
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s12, s7, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s0
|
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[10:11], s[6:7], 24
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s13, s12
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[2:3], s[8:9], s[0:1]
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[6:7], s[10:11], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s2, s2, s0
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s3, s3, s0
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s6, s6, s12
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s7, s7, s12
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[10:11], s[6:7], 0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[12:13], s[2:3], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[10:11], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s10, s6
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s10, s10, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s11, s7
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s7, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s12, s10, s11
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s10, s2
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s10, s10, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s11, s3
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s3, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s16, s10, s11
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s10, s12, s16
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s11, 0, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_gt_u64_e64 s[18:19], s[10:11], 63
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s13, 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[14:15], s[18:19]
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e64 s[18:19], s[10:11], 63
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[20:21], s[14:15], -1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[18:19], s[20:21], s[18:19]
|
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, s[18:19]
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB9_5
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s18, s10, 1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s10
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s19, s11, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s11
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[18:19], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_i32 s10, 63, s10
|
|
|
|
; GCN-IR-NEXT: s_andn2_b64 vcc, exec, vcc
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[14:15], s[2:3], s10
|
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB9_4
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b64 s[18:19], s[2:3], s18
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s10, s6, -1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s11, s7, -1
|
|
|
|
; GCN-IR-NEXT: s_not_b64 s[8:9], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s17, s13
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s12, s8, s16
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s13, s9, s13
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[16:17], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s9, 0
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: BB9_3: ; %udiv-do-while
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b32 s8, s15, 31
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[18:19], s[18:19], 1
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[14:15], s[14:15], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[18:19], s[18:19], s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[16:17], s[14:15]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s8, s10, s18
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s8, s11, s19
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s16, s8, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s17, s16
|
|
|
|
; GCN-IR-NEXT: s_and_b32 s8, s16, 1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[20:21], s[16:17], s[6:7]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s18, s18, s20
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s12
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s19, s19, s21
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s13
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s12, s12, 1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s13, s13, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[12:13], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[16:17], s[8:9]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB9_3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: BB9_4: ; %Flow3
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[10:11], s[14:15], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], s[8:9], s[10:11]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s8
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s9
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_branch BB9_6
|
|
|
|
; GCN-IR-NEXT: BB9_5:
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s3
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v1, v0, 0, s[14:15]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s2
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v0, v0, 0, s[14:15]
|
|
|
|
; GCN-IR-NEXT: BB9_6: ; %udiv-end
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, s6, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v2, s6, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, s7, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, s6, v0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s7, 0xf000
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s2, v0
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, s3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v2, v1, vcc
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, s0, v0
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, s1, v1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v2, s1
|
|
|
|
; GCN-IR-NEXT: v_subrev_i32_e32 v0, vcc, s0, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s6, -1
|
|
|
|
; GCN-IR-NEXT: buffer_store_short v1, off, s[4:7], 0 offset:4
|
|
|
|
; GCN-IR-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%1 = ashr i48 %x, 24
|
|
|
|
%2 = ashr i48 %y, 24
|
|
|
|
%result = srem i48 %1, %2
|
|
|
|
store i48 %result, i48 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem_k_num_i64(i64 addrspace(1)* %out, i64 %x) {
|
|
|
|
; GCN-LABEL: s_test_srem_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v2, 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i32 s0, s7, 31
|
|
|
|
; GCN-NEXT: s_add_u32 s2, s6, s0
|
|
|
|
; GCN-NEXT: s_addc_u32 s3, s7, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s1, s0
|
|
|
|
; GCN-NEXT: s_xor_b64 s[8:9], s[2:3], s[0:1]
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v0, s8
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v1, s9
|
|
|
|
; GCN-NEXT: s_sub_u32 s2, 0, s8
|
|
|
|
; GCN-NEXT: s_subb_u32 s3, 0, s9
|
|
|
|
; GCN-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0x4f800000, v1
|
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v0, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v1, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s6, -1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v0, 0x5f7ffffc, v0
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v3, 0x2f800000, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v3, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mac_f32_e32 v0, 0xcf800000, v3
|
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v0, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v3, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, s2, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, s2, v3
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, s3, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, s2, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v5, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, v0, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v0, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v0, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v3, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, v3, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v5, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v2, v9, vcc
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v3, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v3, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v8, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v7, v6, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v9, v1, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v5, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v0, s[0:1], v0, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v2, v6, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v4, vcc, v3, v5, s[0:1]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, s2, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, s2, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, s3, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v7, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, s2, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v8, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v0, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v12, v0, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v11, v0, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v4, v7
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v4, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v4, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v11, v10
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v11, vcc, v2, v12, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v4, v6
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v7, vcc, v10, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v11, v9, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v8, v1, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v7, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v2, v6, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v5
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e64 v3, vcc, v3, v6, s[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v4
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v3, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, 24, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v3, 24
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, 24, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v0, 0, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, 0, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v5, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v2, vcc, v2, v6, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, 0, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v0, vcc, v2, v0, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v3, v1, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v1, s8, v1
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v2, s8, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v3, s9, v0
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, s8, v0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v0, s[0:1], 24, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v2, vcc, 0, v1
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v3, s9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[0:1]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e64 v4, s[2:3], s8, v0
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v5, vcc, 0, v2, s[2:3]
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s9, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s8, v4
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s9, v5
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v2, vcc, v2, v3, s[2:3]
|
|
|
|
; GCN-NEXT: v_subrev_i32_e32 v3, vcc, s8, v4
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e32 v2, vcc, 0, v2, vcc
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v1, vcc, 0, v1, s[0:1]
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[2:3], 0, v6
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s9, v1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v5, v2, s[2:3]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, 0, -1, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cmp_le_u32_e32 vcc, s8, v0
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v6, 0, -1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, s9, v1
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v5, v5, v6, vcc
|
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v1, v2, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v2, v4, v3, s[2:3]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s4, s3, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s5, s4
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[2:3], s[2:3], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s2, s2, s4
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s3, s3, s4
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s4, s2
|
|
|
|
; GCN-IR-NEXT: s_add_i32 s4, s4, 32
|
|
|
|
; GCN-IR-NEXT: s_flbit_i32_b32 s5, s3
|
|
|
|
; GCN-IR-NEXT: s_cmp_eq_u32 s3, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s8, s4, s5
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s6, s8, 0xffffffc5
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s7, 0, -1
|
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[10:11], s[2:3], 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_gt_u64_e64 s[12:13], s[6:7], 63
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[4:5], 0
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[10:11], s[10:11], s[12:13]
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e64 s[12:13], s[6:7], 63
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[14:15], s[10:11], -1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[12:13], s[14:15], s[12:13]
|
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, s[12:13]
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB10_5
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s12, s6, 1
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s6
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s13, s7, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s7
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[12:13], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_sub_i32 s6, 63, s6
|
|
|
|
; GCN-IR-NEXT: s_andn2_b64 vcc, exec, vcc
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[10:11], 24, s6
|
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB10_4
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b64 s[14:15], 24, s12
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_add_u32 s6, s2, -1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s7, s3, -1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_sub_u32 s8, 58, s8
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s9, 0, 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[12:13], 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s5, 0
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: BB10_3: ; %udiv-do-while
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_lshr_b32 s4, s11, 31
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[14:15], s[14:15], 1
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[10:11], s[10:11], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[14:15], s[14:15], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[10:11], s[12:13], s[10:11]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s4, s6, s14
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s4, s7, s15
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s12, s4, 31
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s13, s12
|
|
|
|
; GCN-IR-NEXT: s_and_b32 s4, s12, 1
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[16:17], s[12:13], s[2:3]
|
|
|
|
; GCN-IR-NEXT: s_sub_u32 s14, s14, s16
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s8
|
|
|
|
; GCN-IR-NEXT: s_subb_u32 s15, s15, s17
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s9
|
|
|
|
; GCN-IR-NEXT: s_add_u32 s8, s8, 1
|
|
|
|
; GCN-IR-NEXT: s_addc_u32 s9, s9, 0
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, s[8:9], v[0:1]
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[12:13], s[4:5]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 vcc, exec, vcc
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_cbranch_vccz BB10_3
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: BB10_4: ; %Flow5
|
|
|
|
; GCN-IR-NEXT: s_lshl_b64 s[6:7], s[10:11], 1
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[4:5], s[4:5], s[6:7]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v0, s4
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, s5
|
2020-04-06 21:05:58 +08:00
|
|
|
; GCN-IR-NEXT: s_branch BB10_6
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: BB10_5:
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v0, 24, 0, s[10:11]
|
|
|
|
; GCN-IR-NEXT: BB10_6: ; %udiv-end
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, s2, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v2, s2, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, s3, v0
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, s2, v0
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v1, v3
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, 0, v1, vcc
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = srem i64 24, %x
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem_k_num_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v1, v2, vcc
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v1, v1, v2
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v0, v0, v2
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v2, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v3, v1
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v4, vcc, 0, v0
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v5, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v12, 0
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v2, 0x4f800000, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v11, 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, 0x5f7ffffc, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v3, 0x2f800000, v2
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v3, v3
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v2, 0xcf800000, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v3, v3
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, v4, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v4, v3
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v5, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v6, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v4, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v6, v8
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v9, v2, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v2, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v10, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v13, v3, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, v3, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v9, vcc, v10, v9
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v3, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, v3, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v12, v8, vcc
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v9, vcc, v9, v10
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v8, v7, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v13, v11, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v7, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v2, s[4:5], v2, v6
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v12, v8, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v6, vcc, v3, v7, s[4:5]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v4, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v4, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v5, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v4, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v8, vcc, v9, v8
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v8, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v13, v2, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v14, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v6, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v6, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v13, v10
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v6, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v13, vcc, v12, v14, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v6, v5
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v10, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v4, vcc, v13, v9, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v8, v11, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v12, v6, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v3, vcc, v3, v5, s[4:5]
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v2, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v3, vcc
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, 24, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v3, 24
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, 24, v3
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v2, 0, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, 0, v3
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v5, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v12, v6, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, 0, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v2, vcc, v5, v2, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v3, v11, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v3, v0, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v4, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v1, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v0, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v4, v3
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v5
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v4, vcc, 0, v3
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v2, vcc, 24, v2
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v4, v1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v5, s[4:5], v2, v0
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v6, s[6:7], 0, v4, s[4:5]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v6, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v5, v0
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v8, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e64 s[6:7], v6, v1
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v4, v1, s[4:5]
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e32 v3, vcc, 0, v3, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, v7, v8, s[6:7]
|
|
|
|
; GCN-NEXT: v_sub_i32_e64 v8, s[4:5], v5, v0
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v4, s[4:5], 0, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v3, v1
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[4:5], 0, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v2, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v0, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, v3, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v7, v0, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, v5, v8, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v1, v6, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v2, v5, vcc
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v2, vcc, 32, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v3, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v8, v3, v2, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_movk_i32 s6, 0xffc5
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, s6, v8
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_addc_u32_e64 v4, s[6:7], 0, -1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[4:5], 0, v[0:1]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, 63, v[3:4]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v9, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[4:5], s[4:5], vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e32 vcc, 63, v[3:4]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v2, 24, 0, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[4:5], s[4:5], -1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, v9
|
|
|
|
; GCN-IR-NEXT: s_and_b64 s[4:5], s[4:5], vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[6:7], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB11_6
|
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v6, vcc, 1, v3
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v7, vcc, 0, v4, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v2, s[4:5], 63, v3
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_u64_e32 vcc, v[6:7], v[3:4]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v4, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], 24, v2
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[4:5], vcc
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[10:11], exec, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB11_5
|
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_lshr_b64 v[10:11], 24, v6
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v6, vcc, -1, v0
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v7, vcc, -1, v1, vcc
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v8, vcc, 58, v8
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v9, vcc, 0, v9, vcc
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: BB11_3: ; %udiv-do-while
|
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[10:11], v[10:11], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_lshrrev_b32_e32 v4, 31, v3
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v10, v10, v4
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], v[2:3], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v4, vcc, v6, v10
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v4, vcc, v7, v11, vcc
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v2, v12, v2
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v12, 31, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v15, v12, v0
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v4, 1, v12
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v14, v12, v1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v12, vcc, 1, v8
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v3, v13, v3
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v13, vcc, 0, v9, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, v[12:13], v[8:9]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v8, v12
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v10, s[4:5], v10, v15
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v9, v13
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v11, s[4:5], v11, v14, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], vcc, s[8:9]
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, v4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_andn2_b64 exec, exec, s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execnz BB11_3
|
|
|
|
; GCN-IR-NEXT: ; %bb.4: ; %Flow
|
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[8:9]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB11_5: ; %Flow3
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[10:11]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], v[2:3], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v5, v5, v3
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v2, v4, v2
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB11_6: ; %Flow4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[6:7]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v3, v0, v5
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v4, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, v1, v2
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v3, vcc, v4, v3
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v3, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = srem i64 24, %x
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem_pow2_k_num_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem_pow2_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v1, vcc, v1, v2, vcc
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v1, v1, v2
|
|
|
|
; GCN-NEXT: v_xor_b32_e32 v0, v0, v2
|
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v2, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_u32_e32 v3, v1
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v4, vcc, 0, v0
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v5, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v12, 0
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v2, 0x4f800000, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_rcp_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mov_b32_e32 v11, 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, 0x5f7ffffc, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_f32_e32 v3, 0x2f800000, v2
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v3, v3
|
|
|
|
; GCN-NEXT: v_mac_f32_e32 v2, 0xcf800000, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v2, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_u32_f32_e32 v3, v3
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v6, v4, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v4, v3
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v5, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v6, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v7, v4, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v6, v8
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v9, v2, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v2, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v10, v2, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v13, v3, v6
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v6, v3, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v9, vcc, v10, v9
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v3, v7
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v7, v3, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v12, v8, vcc
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v9, vcc, v9, v10
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v8, v7, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v8, vcc, v13, v11, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v6, vcc, v7, v6
|
|
|
|
; GCN-NEXT: v_add_i32_e64 v2, s[4:5], v2, v6
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v7, vcc, v12, v8, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v6, vcc, v3, v7, s[4:5]
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v8, v4, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v4, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v5, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v4, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v8, vcc, v9, v8
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v5, vcc, v8, v5
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v10, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v13, v2, v4
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v14, v2, v5
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v9, v6, v4
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v4, v6, v4
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v10, vcc, v13, v10
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v8, v6, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v13, vcc, v12, v14, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v6, v5
|
[AMDGPU] Enable divergence driven ISel for ADD/SUB i64
Summary:
Currently we custom select add/sub with carry out to scalar form relying on later replacing them to vector form if necessary.
This change enables custom selection code to take the divergence of adde/addc SDNodes into account and select the appropriate form in one step.
Reviewers: arsenm, vpykhtin, rampitec
Reviewed By: arsenm, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa
Differential Revision: https://reviews.llvm.org/D76371
2020-03-20 02:33:13 +08:00
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v10, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_addc_u32_e32 v4, vcc, v13, v9, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v6, vcc, v8, v11, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v5
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v12, v6, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v7
|
|
|
|
; GCN-NEXT: v_addc_u32_e64 v3, vcc, v3, v5, s[4:5]
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v2, v4
|
|
|
|
; GCN-NEXT: s_mov_b32 s4, 0x8000
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v3, vcc
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v4, s4, v2
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v5, s4, v3
|
|
|
|
; GCN-NEXT: v_lshlrev_b32_e32 v6, 15, v3
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v2, 0, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, v4, v6
|
|
|
|
; GCN-NEXT: v_mul_hi_u32 v3, 0, v3
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v5, vcc, v12, v5, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v4, vcc, 0, v4
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v2, vcc, v5, v2, vcc
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, v3, v11, vcc
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v3, v0, v3
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_hi_u32 v4, v0, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v5, v1, v2
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v2, v0, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v4, v3
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v3, vcc, v3, v5
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v4, vcc, 0, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v2, vcc, s4, v2
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v4, v1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e64 v5, s[4:5], v2, v0
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v6, s[6:7], 0, v4, s[4:5]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v6, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e64 s[6:7], v5, v0
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v8, 0, -1, s[6:7]
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e64 s[6:7], v6, v1
|
|
|
|
; GCN-NEXT: v_subb_u32_e64 v4, s[4:5], v4, v1, s[4:5]
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_subb_u32_e32 v3, vcc, 0, v3, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, v7, v8, s[6:7]
|
|
|
|
; GCN-NEXT: v_sub_i32_e64 v8, s[4:5], v5, v0
|
|
|
|
; GCN-NEXT: v_subbrev_u32_e64 v4, s[4:5], 0, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v3, v1
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e64 s[4:5], 0, v7
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v7, 0, -1, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_u32_e32 vcc, v2, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v0, 0, -1, vcc
|
|
|
|
; GCN-NEXT: v_cmp_eq_u32_e32 vcc, v3, v1
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v7, v0, vcc
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v5, v5, v8, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0
|
[AMDGPU] Extend macro fusion for ADDC and SUBB to SUBBREV
Summary:
There's a lot of test case churn but the overall effect is to increase
the number of back-to-back v_sub,v_subbrev pairs, which can execute with
no delay even on gfx10.
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75999
2020-03-12 01:01:24 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e64 v1, v6, v4, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v0, v2, v5, vcc
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, v3, v1, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem_pow2_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v2, v0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v2, vcc, 32, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v3, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v8, v3, v2, vcc
|
|
|
|
; GCN-IR-NEXT: s_movk_i32 s6, 0xffd0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v2, vcc, s6, v8
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e64 v3, s[6:7], 0, -1, vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e64 s[4:5], 0, v[0:1]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, 63, v[2:3]
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s8, 0x8000
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[4:5], s[4:5], vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v4, s8
|
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e32 vcc, 63, v[2:3]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v9, 0
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v4, v4, 0, s[4:5]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[4:5], s[4:5], -1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s9, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, v9
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 s[4:5], s[4:5], vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[6:7], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB12_6
|
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v6, vcc, 1, v2
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v7, vcc, 0, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_u64_e32 vcc, v[6:7], v[2:3]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v2, s[4:5], 63, v2
|
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], s[8:9], v2
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v4, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[4:5], vcc
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[10:11], exec, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB12_5
|
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s5, 0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s4, 0x8000
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_lshr_b64 v[10:11], s[4:5], v6
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v6, vcc, -1, v0
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v7, vcc, -1, v1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v8, vcc, 47, v8
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v9, vcc, 0, v9, vcc
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: BB12_3: ; %udiv-do-while
|
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[10:11], v[10:11], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_lshrrev_b32_e32 v4, 31, v3
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v10, v10, v4
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], v[2:3], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v4, vcc, v6, v10
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v4, vcc, v7, v11, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v2, v12, v2
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v12, 31, v4
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v15, v12, v0
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v4, 1, v12
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v14, v12, v1
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v12, vcc, 1, v8
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v3, v13, v3
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v13, vcc, 0, v9, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, v[12:13], v[8:9]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v8, v12
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v5, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v10, s[4:5], v10, v15
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v9, v13
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v11, s[4:5], v11, v14, s[4:5]
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], vcc, s[8:9]
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, v4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_andn2_b64 exec, exec, s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execnz BB12_3
|
|
|
|
; GCN-IR-NEXT: ; %bb.4: ; %Flow
|
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[8:9]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB12_5: ; %Flow3
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[10:11]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[2:3], v[2:3], 1
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-24 01:55:36 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v5, v5, v3
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v4, v4, v2
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB12_6: ; %Flow4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[6:7]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v2, v0, v5
|
|
|
|
; GCN-IR-NEXT: v_mul_hi_u32 v3, v0, v4
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v1, v1, v4
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, v4
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v2, vcc, v3, v2
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 0x8000, v0
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = srem i64 32768, %x
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem_pow2_k_den_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem_pow2_k_den_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-NEXT: v_lshrrev_b32_e32 v2, 17, v2
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_and_b32_e32 v2, 0xffff8000, v2
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v1, vcc, v1, v3, vcc
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem_pow2_k_den_i64:
|
|
|
|
; GCN-IR: ; %bb.0: ; %_udiv-special-cases
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v2, 31, v1
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v2
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v3, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v2, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e64 v3, s[4:5], 32, v3
|
|
|
|
; GCN-IR-NEXT: v_ffbh_u32_e32 v4, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u32_e64 s[4:5], 0, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v8, v4, v3, s[4:5]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v4, s[4:5], 48, v8
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v5, s[4:5], 0, 0, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_eq_u64_e32 vcc, 0, v[0:1]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e64 s[4:5], 63, v[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v3, v2
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ne_u64_e32 vcc, 63, v[4:5]
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[6:7], s[4:5], -1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v7, v1, 0, s[4:5]
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e64 v6, v0, 0, s[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_and_b64 s[4:5], s[6:7], vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[6:7], s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB13_6
|
|
|
|
; GCN-IR-NEXT: ; %bb.1: ; %udiv-bb1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v9, vcc, 1, v4
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v10, vcc, 0, v5, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_u64_e32 vcc, v[9:10], v[4:5]
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v4, s[4:5], 63, v4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v6, 0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[4:5], v[0:1], v4
|
|
|
|
; GCN-IR-NEXT: s_mov_b64 s[8:9], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v7, 0
|
|
|
|
; GCN-IR-NEXT: s_and_saveexec_b64 s[4:5], vcc
|
|
|
|
; GCN-IR-NEXT: s_xor_b64 s[10:11], exec, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execz BB13_5
|
|
|
|
; GCN-IR-NEXT: ; %bb.2: ; %udiv-preheader
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, 0
|
|
|
|
; GCN-IR-NEXT: v_lshr_b64 v[10:11], v[0:1], v9
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v8, vcc, 0xffffffcf, v8
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e64 v9, s[4:5], 0, -1, vcc
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_movk_i32 s12, 0x7fff
|
|
|
|
; GCN-IR-NEXT: BB13_3: ; %udiv-do-while
|
|
|
|
; GCN-IR-NEXT: ; =>This Inner Loop Header: Depth=1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[10:11], v[10:11], 1
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshrrev_b32_e32 v6, 31, v5
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v10, v10, v6
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[4:5], v[4:5], 1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v6, vcc, s12, v10
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v6, vcc, 0, v11, vcc
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v4, v12, v4
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v12, 31, v6
|
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v14, 0x8000, v12
|
|
|
|
; GCN-IR-NEXT: v_and_b32_e32 v6, 1, v12
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v12, vcc, 1, v8
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v5, v13, v5
|
|
|
|
; GCN-IR-NEXT: v_addc_u32_e32 v13, vcc, 0, v9, vcc
|
|
|
|
; GCN-IR-NEXT: v_cmp_lt_u64_e32 vcc, v[12:13], v[8:9]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v8, v12
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v7, 0
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v9, v13
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v13, v7
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v15, 0
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e64 v10, s[4:5], v10, v14
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e64 v11, s[4:5], v11, v15, s[4:5]
|
|
|
|
; GCN-IR-NEXT: s_or_b64 s[8:9], vcc, s[8:9]
|
|
|
|
; GCN-IR-NEXT: v_mov_b32_e32 v12, v6
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_andn2_b64 exec, exec, s[8:9]
|
|
|
|
; GCN-IR-NEXT: s_cbranch_execnz BB13_3
|
|
|
|
; GCN-IR-NEXT: ; %bb.4: ; %Flow
|
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[8:9]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: BB13_5: ; %Flow3
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[10:11]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[4:5], v[4:5], 1
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v7, v7, v5
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v6, v6, v4
|
|
|
|
; GCN-IR-NEXT: BB13_6: ; %Flow4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b64 exec, exec, s[6:7]
|
2020-02-15 08:57:38 +08:00
|
|
|
; GCN-IR-NEXT: v_lshl_b64 v[4:5], v[6:7], 15
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v4
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v5, vcc
|
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v0, v0, v2
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_xor_b32_e32 v1, v1, v3
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-IR-NEXT: v_subb_u32_e32 v1, vcc, v1, v3, vcc
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%result = srem i64 %x, 32768
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem24_k_num_i64(i64 addrspace(1)* %out, i64 %x) {
|
|
|
|
; GCN-LABEL: s_test_srem24_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s6, 0x41c00000
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[4:5], s[2:3], 40
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s4
|
|
|
|
; GCN-NEXT: s_ashr_i32 s5, s4, 30
|
|
|
|
; GCN-NEXT: s_or_b32 s5, s5, 1
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v1, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v1, s6, v1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v1, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mad_f32 v2, -v1, v0, s6
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v1, v1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[6:7], |v2|, |v0|
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s6, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s5, s5, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s5, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s4
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem24_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s6, 0x41c00000
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[4:5], s[2:3], 40
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s4
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s5, s4, 30
|
|
|
|
; GCN-IR-NEXT: s_or_b32 s5, s5, 1
|
2020-06-19 22:39:55 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v1, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v1, s6, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v1, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v2, -v1, v0, s6
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v1, v1
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[6:7], |v2|, |v0|
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s6, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s5, s5, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s5, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s4
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%x.shr = ashr i64 %x, 40
|
|
|
|
%result = srem i64 24, %x.shr
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define amdgpu_kernel void @s_test_srem24_k_den_i64(i64 addrspace(1)* %out, i64 %x) {
|
|
|
|
; GCN-LABEL: s_test_srem24_k_den_i64:
|
|
|
|
; GCN: ; %bb.0:
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s1, 0x46b6fe00
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-NEXT: s_mov_b32 s2, -1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_ashr_i64 s[6:7], s[6:7], 40
|
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v0, s6
|
|
|
|
; GCN-NEXT: s_ashr_i32 s0, s6, 30
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-NEXT: s_or_b32 s7, s0, 1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v1, 0x38331158, v0
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_mad_f32 v0, -v1, s1, v0
|
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v1, v1
|
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 s[0:1], |v0|, s1
|
|
|
|
; GCN-NEXT: s_cmp_lg_u32 s0, 0
|
|
|
|
; GCN-NEXT: s_cselect_b32 s0, s7, 0
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: s_movk_i32 s0, 0x5b7f
|
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-NEXT: s_mov_b32 s0, s4
|
|
|
|
; GCN-NEXT: s_mov_b32 s1, s5
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_endpgm
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: s_test_srem24_k_den_i64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, 0x46b6fe00
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s2, -1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_ashr_i64 s[6:7], s[6:7], 40
|
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v0, s6
|
|
|
|
; GCN-IR-NEXT: s_ashr_i32 s0, s6, 30
|
[AMDGPU] Select s_cselect
Summary:
Add patterns to select s_cselect in the isel.
Handle more cases of implicit SCC accesses in si-fix-sgpr-copies
to allow new patterns to work.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, asbirlea, kerbowa, llvm-commits
Tags: #llvm
Re-commit D81925 with a bugfix D82370.
Differential Revision: https://reviews.llvm.org/D81925
Differential Revision: https://reviews.llvm.org/D82370
2020-03-04 22:13:08 +08:00
|
|
|
; GCN-IR-NEXT: s_or_b32 s7, s0, 1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v1, 0x38331158, v0
|
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v1, v1
|
|
|
|
; GCN-IR-NEXT: v_mad_f32 v0, -v1, s1, v0
|
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v1, v1
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 s[0:1], |v0|, s1
|
|
|
|
; GCN-IR-NEXT: s_cmp_lg_u32 s0, 0
|
|
|
|
; GCN-IR-NEXT: s_cselect_b32 s0, s7, 0
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v0, vcc, s0, v1
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: s_movk_i32 s0, 0x5b7f
|
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v0, s0
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s0, s4
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s1, s5
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, s6, v0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: s_endpgm
|
2020-01-19 05:51:43 +08:00
|
|
|
%x.shr = ashr i64 %x, 40
|
|
|
|
%result = srem i64 %x.shr, 23423
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem24_k_num_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem24_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-NEXT: s_mov_b32 s4, 0x41c00000
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v3, 30, v0
|
|
|
|
; GCN-NEXT: v_or_b32_e32 v3, 1, v3
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, s4, v2
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
|
|
|
; GCN-NEXT: v_mad_f32 v4, -v2, v1, s4
|
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 vcc, |v4|, |v1|
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v1, v0
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem24_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s4, 0x41c00000
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v3, 30, v0
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v3, 1, v3
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, s4, v2
|
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
|
|
|
; GCN-IR-NEXT: v_mad_f32 v4, -v2, v1, s4
|
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 vcc, |v4|, |v1|
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v1, v0
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 24, v0
|
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%x.shr = ashr i64 %x, 40
|
|
|
|
%result = srem i64 24, %x.shr
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem24_pow2_k_num_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem24_pow2_k_num_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-NEXT: s_mov_b32 s4, 0x47000000
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v3, 30, v0
|
|
|
|
; GCN-NEXT: v_or_b32_e32 v3, 1, v3
|
|
|
|
; GCN-NEXT: v_rcp_iflag_f32_e32 v2, v1
|
|
|
|
; GCN-NEXT: v_mul_f32_e32 v2, s4, v2
|
|
|
|
; GCN-NEXT: v_trunc_f32_e32 v2, v2
|
|
|
|
; GCN-NEXT: v_mad_f32 v4, -v2, v1, s4
|
|
|
|
; GCN-NEXT: v_cvt_i32_f32_e32 v2, v2
|
|
|
|
; GCN-NEXT: v_cmp_ge_f32_e64 vcc, |v4|, |v1|
|
|
|
|
; GCN-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: v_mul_lo_u32 v0, v1, v0
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, 0x8000, v0
|
|
|
|
; GCN-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem24_pow2_k_num_i64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s4, 0x47000000
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v3, 30, v0
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v3, 1, v3
|
|
|
|
; GCN-IR-NEXT: v_rcp_iflag_f32_e32 v2, v1
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v2, s4, v2
|
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v2, v2
|
|
|
|
; GCN-IR-NEXT: v_mad_f32 v4, -v2, v1, s4
|
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v2, v2
|
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 vcc, |v4|, |v1|
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v1, 0, v3, vcc
|
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v2, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_mul_lo_u32 v0, v1, v0
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, 0x8000, v0
|
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%x.shr = ashr i64 %x, 40
|
|
|
|
%result = srem i64 32768, %x.shr
|
|
|
|
ret i64 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @v_test_srem24_pow2_k_den_i64(i64 %x) {
|
|
|
|
; GCN-LABEL: v_test_srem24_pow2_k_den_i64:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-01-26 01:36:21 +08:00
|
|
|
; GCN-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-NEXT: v_lshrrev_b32_e32 v2, 17, v1
|
|
|
|
; GCN-NEXT: v_add_i32_e32 v2, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_addc_u32_e32 v3, vcc, 0, v1, vcc
|
|
|
|
; GCN-NEXT: v_and_b32_e32 v2, 0xffff8000, v2
|
|
|
|
; GCN-NEXT: v_sub_i32_e32 v0, vcc, v0, v2
|
|
|
|
; GCN-NEXT: v_subb_u32_e32 v1, vcc, v1, v3, vcc
|
2020-01-19 05:51:43 +08:00
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 11:41:36 +08:00
|
|
|
;
|
|
|
|
; GCN-IR-LABEL: v_test_srem24_pow2_k_den_i64:
|
|
|
|
; GCN-IR: ; %bb.0:
|
|
|
|
; GCN-IR-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-IR-NEXT: v_ashr_i64 v[0:1], v[0:1], 40
|
|
|
|
; GCN-IR-NEXT: s_mov_b32 s4, 0x47000000
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_f32_i32_e32 v1, v0
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v2, 30, v0
|
|
|
|
; GCN-IR-NEXT: v_or_b32_e32 v2, 1, v2
|
|
|
|
; GCN-IR-NEXT: v_mul_f32_e32 v3, 0x38000000, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_trunc_f32_e32 v3, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_mad_f32 v1, -v3, s4, v1
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_cvt_i32_f32_e32 v3, v3
|
2020-02-13 19:44:52 +08:00
|
|
|
; GCN-IR-NEXT: v_cmp_ge_f32_e64 vcc, |v1|, s4
|
|
|
|
; GCN-IR-NEXT: v_cndmask_b32_e32 v1, 0, v2, vcc
|
2020-01-19 11:41:36 +08:00
|
|
|
; GCN-IR-NEXT: v_add_i32_e32 v1, vcc, v3, v1
|
|
|
|
; GCN-IR-NEXT: v_lshlrev_b32_e32 v1, 15, v1
|
|
|
|
; GCN-IR-NEXT: v_sub_i32_e32 v0, vcc, v0, v1
|
|
|
|
; GCN-IR-NEXT: v_bfe_i32 v0, v0, 0, 24
|
|
|
|
; GCN-IR-NEXT: v_ashrrev_i32_e32 v1, 31, v0
|
|
|
|
; GCN-IR-NEXT: s_setpc_b64 s[30:31]
|
2020-01-19 05:51:43 +08:00
|
|
|
%x.shr = ashr i64 %x, 40
|
|
|
|
%result = srem i64 %x.shr, 32768
|
|
|
|
ret i64 %result
|
|
|
|
}
|