[llvm] [AMDGPU] Add SSA-form memory clause pass (AMDGPUFormSSAMemoryClauses) (PR #209656)
Jun Wang via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 08:46:54 PDT 2026
================
@@ -0,0 +1,434 @@
+//===-- AMDGPUFormSSAMemoryClauses.cpp ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file This pass is a clone of SIFormMemoryClauses intended to run in SSA
+/// form, before PHI elimination. It extends the live ranges of registers used
+/// as pointers in sequences of adjacent SMEM and VMEM instructions when XNACK
+/// is enabled, preventing a load from overwriting a pointer and requiring a
+/// soft clause break.
+///
+//===----------------------------------------------------------------------===//
+
+#include "AMDGPUFormSSAMemoryClauses.h"
+#include "AMDGPU.h"
+#include "GCNRegPressure.h"
+#include "SIMachineFunctionInfo.h"
+#include "llvm/CodeGen/LiveIntervals.h"
+#include "llvm/InitializePasses.h"
+
+using namespace llvm;
+
+#define DEBUG_TYPE "amdgpu-form-ssa-memory-clauses"
+
+// Clauses longer then 15 instructions would overflow one of the counters
+// and stall. They can stall even earlier if there are outstanding counters.
+static cl::opt<unsigned> SSAMaxClause(
----------------
jwanggit86 wrote:
Done.
https://github.com/llvm/llvm-project/pull/209656
More information about the llvm-commits
mailing list