[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:39 PST 2025


================
@@ -151,6 +156,28 @@ bool llvm::GenericUniformityAnalysisImpl<MachineSSAContext>::isDivergentUse(
   return isTemporalDivergent(*UseInstr->getParent(), *DefInstr);
 }
 
+template <>
+bool GenericUniformityAnalysisImpl<MachineSSAContext>::isCustomUniform(
+    const MachineInstr &MI) const {
+  const auto &InstrInfo = *F.getSubtarget().getInstrInfo();
+
+  // Build bitvector of uniform register use operands
+  SmallVector<const MachineOperand *, 4> RegUseOps;
----------------
arsenm wrote:

Keep this simple and index just by raw operand index, instead of filtering for virtual register uses 

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


More information about the llvm-commits mailing list