[llvm] [AMDGPU] Pre-commit unit test for RP tracking `reset`/`advance` inconsistencies fix (PR #196098)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 05:33:44 PDT 2026


================
@@ -0,0 +1,195 @@
+//===- GCNRegPressureTest.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
+//
+//===----------------------------------------------------------------------===//
+
+#include "GCNRegPressure.h"
+#include "AMDGPUTargetMachine.h"
+#include "AMDGPUUnitTests.h"
+#include "llvm/Analysis/CGSCCPassManager.h"
+#include "llvm/Analysis/LoopAnalysisManager.h"
+#include "llvm/CodeGen/LiveIntervals.h"
+#include "llvm/CodeGen/MIRParser/MIRParser.h"
+#include "llvm/CodeGen/MachineFunctionAnalysis.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/MachinePassManager.h"
+#include "llvm/CodeGen/MachineScheduler.h"
+#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/TargetLowering.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Passes/PassBuilder.h"
+#include "llvm/Target/TargetMachine.h"
+#include "gtest/gtest.h"
+
+using namespace llvm;
+
+class GCNRegPressureTest : public testing::Test {
+public:
+  LLVMContext Context;
+  std::unique_ptr<GCNTargetMachine> TM;
+  std::unique_ptr<MachineModuleInfo> MMI;
+
+  LoopAnalysisManager LAM;
+  MachineFunctionAnalysisManager MFAM;
+  FunctionAnalysisManager FAM;
+  CGSCCAnalysisManager CGAM;
+  ModulePassManager MPM;
+  FunctionPassManager FPM;
+  MachineFunctionPassManager MFPM;
+  ModuleAnalysisManager MAM;
+
+  static void SetUpTestCase() { initializeAMDGPUTarget(); }
----------------
rovka wrote:

...once? Also, do we really need to call this both here and in SetUp (via createAMDGPUTargetMachine)?

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


More information about the llvm-commits mailing list