Resubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI
Summary:
Enable the new diveregence analysis by default for AMDGPU.
Resubmit with test updates since GPUDA was causing failures on Windows.
Reviewers: rampitec, nhaehnle, arsenm, thakis
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73315
2020-01-20 23:25:20 +08:00
|
|
|
; RUN: opt -mtriple=amdgcn-- -amdgpu-use-legacy-divergence-analysis -analyze -divergence %s | FileCheck %s
|
2016-03-18 00:21:59 +08:00
|
|
|
|
|
|
|
; CHECK: DIVERGENT: %orig = atomicrmw xchg i32* %ptr, i32 %val seq_cst
|
|
|
|
define i32 @test1(i32* %ptr, i32 %val) #0 {
|
|
|
|
%orig = atomicrmw xchg i32* %ptr, i32 %val seq_cst
|
|
|
|
ret i32 %orig
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: DIVERGENT: %orig = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
define {i32, i1} @test2(i32* %ptr, i32 %cmp, i32 %new) {
|
|
|
|
%orig = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
ret {i32, i1} %orig
|
|
|
|
}
|
|
|
|
|
2017-03-31 06:21:40 +08:00
|
|
|
; CHECK: DIVERGENT: %ret = call i32 @llvm.amdgcn.atomic.inc.i32.p1i32(i32 addrspace(1)* %ptr, i32 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
define i32 @test_atomic_inc_i32(i32 addrspace(1)* %ptr, i32 %val) #0 {
|
2017-03-31 06:21:40 +08:00
|
|
|
%ret = call i32 @llvm.amdgcn.atomic.inc.i32.p1i32(i32 addrspace(1)* %ptr, i32 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
ret i32 %ret
|
|
|
|
}
|
|
|
|
|
2017-03-31 06:21:40 +08:00
|
|
|
; CHECK: DIVERGENT: %ret = call i64 @llvm.amdgcn.atomic.inc.i64.p1i64(i64 addrspace(1)* %ptr, i64 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
define i64 @test_atomic_inc_i64(i64 addrspace(1)* %ptr, i64 %val) #0 {
|
2017-03-31 06:21:40 +08:00
|
|
|
%ret = call i64 @llvm.amdgcn.atomic.inc.i64.p1i64(i64 addrspace(1)* %ptr, i64 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
ret i64 %ret
|
|
|
|
}
|
|
|
|
|
2017-03-31 06:21:40 +08:00
|
|
|
; CHECK: DIVERGENT: %ret = call i32 @llvm.amdgcn.atomic.dec.i32.p1i32(i32 addrspace(1)* %ptr, i32 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
define i32 @test_atomic_dec_i32(i32 addrspace(1)* %ptr, i32 %val) #0 {
|
2017-03-31 06:21:40 +08:00
|
|
|
%ret = call i32 @llvm.amdgcn.atomic.dec.i32.p1i32(i32 addrspace(1)* %ptr, i32 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
ret i32 %ret
|
|
|
|
}
|
|
|
|
|
2017-03-31 06:21:40 +08:00
|
|
|
; CHECK: DIVERGENT: %ret = call i64 @llvm.amdgcn.atomic.dec.i64.p1i64(i64 addrspace(1)* %ptr, i64 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
define i64 @test_atomic_dec_i64(i64 addrspace(1)* %ptr, i64 %val) #0 {
|
2017-03-31 06:21:40 +08:00
|
|
|
%ret = call i64 @llvm.amdgcn.atomic.dec.i64.p1i64(i64 addrspace(1)* %ptr, i64 %val, i32 0, i32 0, i1 false)
|
2017-01-31 01:09:47 +08:00
|
|
|
ret i64 %ret
|
|
|
|
}
|
|
|
|
|
2017-03-31 06:21:40 +08:00
|
|
|
declare i32 @llvm.amdgcn.atomic.inc.i32.p1i32(i32 addrspace(1)* nocapture, i32, i32, i32, i1) #1
|
|
|
|
declare i64 @llvm.amdgcn.atomic.inc.i64.p1i64(i64 addrspace(1)* nocapture, i64, i32, i32, i1) #1
|
|
|
|
declare i32 @llvm.amdgcn.atomic.dec.i32.p1i32(i32 addrspace(1)* nocapture, i32, i32, i32, i1) #1
|
|
|
|
declare i64 @llvm.amdgcn.atomic.dec.i64.p1i64(i64 addrspace(1)* nocapture, i64, i32, i32, i1) #1
|
2017-01-31 01:09:47 +08:00
|
|
|
|
2016-04-13 08:39:48 +08:00
|
|
|
attributes #0 = { nounwind }
|
2017-01-31 01:09:47 +08:00
|
|
|
attributes #1 = { nounwind argmemonly }
|