[llvm] [AMDGPU] Enable "amdgpu-uniform-intrinsic-combine" pass in pipeline. (PR #162819)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 08:27:35 PDT 2025


================
@@ -148,6 +148,62 @@ static bool runUniformIntrinsicCombine(Module &M, ModuleAnalysisManager &AM) {
   return IsChanged;
 }
 
+// Legacy PM version
+static bool runUniformIntrinsicCombine(Module &M, ModulePass &P) {
+  bool IsChanged = false;
+  ValueMap<const Value *, bool> Tracker;
+
+  for (Function &F : M) {
+    switch (F.getIntrinsicID()) {
+    case Intrinsic::amdgcn_permlane64:
+    case Intrinsic::amdgcn_readfirstlane:
+    case Intrinsic::amdgcn_readlane:
+    case Intrinsic::amdgcn_ballot:
+      break;
+    default:
+      continue;
+    }
+
+    for (User *U : make_early_inc_range(F.users())) {
+      auto *II = cast<IntrinsicInst>(U);
+      Function *ParentF = II->getFunction();
----------------
arsenm wrote:

This is still running on optnone functions, another issue with doing this as a module pass 

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


More information about the llvm-commits mailing list