[llvm] [AMDGPU] Fix layering violations in AMDGPUMCExpr.cpp. NFC (PR #168242)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 16 05:06:59 PST 2025


================
@@ -317,30 +315,6 @@ const AMDGPUMCExpr *AMDGPUMCExpr::createTotalNumVGPR(const MCExpr *NumAGPR,
   return create(AGVK_TotalNumVGPRs, {NumAGPR, NumVGPR}, Ctx);
 }
 
-/// Mimics GCNSubtarget::computeOccupancy for MCExpr.
-///
-/// Remove dependency on GCNSubtarget and depend only only the necessary values
-/// for said occupancy computation. Should match computeOccupancy implementation
-/// without passing \p STM on.
-const AMDGPUMCExpr *AMDGPUMCExpr::createOccupancy(
-    unsigned InitOcc, const MCExpr *NumSGPRs, const MCExpr *NumVGPRs,
-    unsigned DynamicVGPRBlockSize, const GCNSubtarget &STM, MCContext &Ctx) {
----------------
s-barannikov wrote:

Maybe just change STM to MCSubtargetInfo? Only STM.getGeneration needs GCNSubtarget, but it could be  transformed into a function accepting MCSubtargetInfo like others?

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


More information about the llvm-commits mailing list