[llvm] [AMDGPU][TTI] Add target hook for the custom instruction uniformity (PR #137639)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 22:03:02 PDT 2025
================
@@ -147,6 +147,17 @@ bool llvm::GenericUniformityAnalysisImpl<MachineSSAContext>::isDivergentUse(
return isTemporalDivergent(*UseInstr->getParent(), *DefInstr);
}
+template <>
+bool GenericUniformityAnalysisImpl<MachineSSAContext>::isOperandUniform(
+ const MachineInstr &I, InstructionUniformity IU) const {
+ switch (IU) {
+ case InstructionUniformity::EitherOfFirstTwoOp:
+ return !isDivergentUse(I.getOperand(0)) || !isDivergentUse(I.getOperand(1));
----------------
arsenm wrote:
This API will work poorly for machine instrs. This will typically be the def
https://github.com/llvm/llvm-project/pull/137639
More information about the llvm-commits
mailing list