Sameer Sahasrabuddhe 11bf7da64a [NewPM] Introduce (GPU)DivergenceAnalysis in the new pass manager
The GPUDivergenceAnalysis is now renamed to just "DivergenceAnalysis"
since there is no conflict with LegacyDivergenceAnalysis. In the
legacy PM, this analysis can only be used through the legacy DA
serving as a wrapper. It is now made available as a pass in the new
PM, and has no relation with the legacy DA.

The new DA currently cannot handle irreducible control flow; its
presence can cause the analysis to run indefinitely. The analysis is
now modified to detect this and report all instructions in the
function as divergent. This is super conservative, but allows the
analysis to be used without hanging the compiler.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D96615
2021-02-16 10:26:45 +05:30

16 lines
569 B
LLVM

; RUN: opt -mtriple=amdgcn-- -amdgpu-use-legacy-divergence-analysis -enable-new-pm=0 -analyze -divergence %s | FileCheck %s
; Test that we consider loads from flat and private addrspaces to be divergent.
; CHECK: DIVERGENT: %val = load i32, i32* %flat, align 4
define amdgpu_kernel void @flat_load(i32* %flat) {
%val = load i32, i32* %flat, align 4
ret void
}
; CHECK: DIVERGENT: %val = load i32, i32 addrspace(5)* %priv, align 4
define amdgpu_kernel void @private_load(i32 addrspace(5)* %priv) {
%val = load i32, i32 addrspace(5)* %priv, align 4
ret void
}