[PATCH] D150438: [LLVM][Uniformity] Improve detection of uniform registers
Sameer Sahasrabuddhe via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 12 04:15:22 PDT 2023
sameerds created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, jvesely, arsenm.
Herald added a project: All.
sameerds requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The MachineUA now queries the target to determine if a given register holds a
uniform value. This is determined using the corresponding register bank if
available, or by a combination of the register class and value type. This
assumes that the target is optimizing for performance by choosing registers, and
the target is responsible for any mismatch with the inferred uniformity.
For example, on AMDGPU, an SGPR is now treated as uniform, except if the
register bank is VCC (i.e., the register holds a wave-wide vector of 1-bit
values) or equivalently if it has a value type of s1.
- This does not always work with inline asm, where the register bank or the value type might not be present. We assume that the SGPR is uniform, because it is not expected to be s1 in the vast majority of cases.
- The pseudo branch instruction SI_LOOP is now hard-coded to be always divergent, although its condition is an SGPR.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D150438
Files:
llvm/include/llvm/ADT/GenericUniformityImpl.h
llvm/include/llvm/CodeGen/RegisterBankInfo.h
llvm/include/llvm/CodeGen/TargetRegisterInfo.h
llvm/lib/Analysis/UniformityAnalysis.cpp
llvm/lib/CodeGen/MachineUniformityAnalysis.cpp
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.h
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/always-uniform-gmir.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/atomics.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/hidden-diverge.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/hidden-loop-diverge.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/irreducible/irreducible-1.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/never-uniform.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/temporal-diverge-gmir.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/MIR/temporal-divergence.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/deprecated/hidden-diverge.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/deprecated/irreducible-1.mir
llvm/test/Analysis/UniformityAnalysis/AMDGPU/temporal_diverge.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150438.521602.patch
Type: text/x-patch
Size: 24019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230512/a55aa749/attachment.bin>
More information about the llvm-commits
mailing list