[llvm] [AMDGPU][Uniformity][TTI] Make Uniformity Analysis Operand-Aware with Custom Target Hook (PR #137639)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 16 05:23:38 PST 2025


================
@@ -108,6 +114,19 @@ bool llvm::GenericUniformityAnalysisImpl<SSAContext>::isDivergentUse(
   return false;
 }
 
+template <>
+bool GenericUniformityAnalysisImpl<SSAContext>::isCustomUniform(
+    const Instruction &I) const {
+  // Build bitvector of uniform operands
+  SmallBitVector UniformArgs(I.getNumOperands());
+  for (unsigned OpIdx = 0; OpIdx < I.getNumOperands(); ++OpIdx) {
----------------
arsenm wrote:

```suggestion
  for (unsigned OpIdx = 0, E =UniformArgs.size(); OpIdx != E; ++OpIdx) {
```

https://github.com/llvm/llvm-project/pull/137639


More information about the llvm-commits mailing list