[llvm] [AMDGPU] Fix unittest linking error with `LLVM_LINK_LLVM_DYLIB` (PR #91727)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 04:18:37 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 73681b8fee930274e6dc11d4471b44666d6d0dfd 853ec603868523e46d873afbdab5f77501916a87 -- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h llvm/lib/Target/AMDGPU/SIProgramInfo.h llvm/unittests/MC/AMDGPU/SIProgramInfoMCExprs.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIProgramInfo.h b/llvm/lib/Target/AMDGPU/SIProgramInfo.h
index e66e5a194c..fc45ad5a4a 100644
--- a/llvm/lib/Target/AMDGPU/SIProgramInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIProgramInfo.h
@@ -29,87 +29,87 @@ class MachineFunction;
 
 /// Track resource usage for kernels / entry functions.
 struct LLVM_EXTERNAL_VISIBILITY SIProgramInfo {
-    // Fields set in PGM_RSRC1 pm4 packet.
-    const MCExpr *VGPRBlocks = nullptr;
-    const MCExpr *SGPRBlocks = nullptr;
-    uint32_t Priority = 0;
-    uint32_t FloatMode = 0;
-    uint32_t Priv = 0;
-    uint32_t DX10Clamp = 0;
-    uint32_t DebugMode = 0;
-    uint32_t IEEEMode = 0;
-    uint32_t WgpMode = 0; // GFX10+
-    uint32_t MemOrdered = 0; // GFX10+
-    uint32_t RrWgMode = 0;   // GFX12+
-    const MCExpr *ScratchSize = nullptr;
-
-    // State used to calculate fields set in PGM_RSRC2 pm4 packet.
-    uint32_t LDSBlocks = 0;
-    const MCExpr *ScratchBlocks = nullptr;
-
-    // Fields set in PGM_RSRC2 pm4 packet
-    const MCExpr *ScratchEnable = nullptr;
-    uint32_t UserSGPR = 0;
-    uint32_t TrapHandlerEnable = 0;
-    uint32_t TGIdXEnable = 0;
-    uint32_t TGIdYEnable = 0;
-    uint32_t TGIdZEnable = 0;
-    uint32_t TGSizeEnable = 0;
-    uint32_t TIdIGCompCount = 0;
-    uint32_t EXCPEnMSB = 0;
-    uint32_t LdsSize = 0;
-    uint32_t EXCPEnable = 0;
-
-    const MCExpr *ComputePGMRSrc3GFX90A = nullptr;
-
-    const MCExpr *NumVGPR = nullptr;
-    const MCExpr *NumArchVGPR = nullptr;
-    const MCExpr *NumAccVGPR = nullptr;
-    const MCExpr *AccumOffset = nullptr;
-    uint32_t TgSplit = 0;
-    const MCExpr *NumSGPR = nullptr;
-    unsigned SGPRSpill = 0;
-    unsigned VGPRSpill = 0;
-    uint32_t LDSSize = 0;
-    const MCExpr *FlatUsed = nullptr;
-
-    // Number of SGPRs that meets number of waves per execution unit request.
-    const MCExpr *NumSGPRsForWavesPerEU = nullptr;
-
-    // Number of VGPRs that meets number of waves per execution unit request.
-    const MCExpr *NumVGPRsForWavesPerEU = nullptr;
-
-    // Final occupancy.
-    const MCExpr *Occupancy = nullptr;
-
-    // Whether there is recursion, dynamic allocas, indirect calls or some other
-    // reason there may be statically unknown stack usage.
-    const MCExpr *DynamicCallStack = nullptr;
-
-    // Bonus information for debugging.
-    const MCExpr *VCCUsed = nullptr;
-
-    SIProgramInfo() = default;
-
-    // The constructor sets the values for each member as shown in the struct.
-    // However, setting the MCExpr members to their zero value equivalent
-    // happens in reset together with (duplicated) value re-set for the
-    // non-MCExpr members.
-    void reset(const MachineFunction &MF);
-
-    /// Compute the value of the ComputePGMRsrc1 register.
-    uint64_t getComputePGMRSrc1(const GCNSubtarget &ST) const;
-    uint64_t getPGMRSrc1(CallingConv::ID CC, const GCNSubtarget &ST) const;
-    const MCExpr *getComputePGMRSrc1(const GCNSubtarget &ST,
-                                     MCContext &Ctx) const;
-    const MCExpr *getPGMRSrc1(CallingConv::ID CC, const GCNSubtarget &ST,
-                              MCContext &Ctx) const;
-
-    /// Compute the value of the ComputePGMRsrc2 register.
-    uint64_t getComputePGMRSrc2() const;
-    uint64_t getPGMRSrc2(CallingConv::ID CC) const;
-    const MCExpr *getComputePGMRSrc2(MCContext &Ctx) const;
-    const MCExpr *getPGMRSrc2(CallingConv::ID CC, MCContext &Ctx) const;
+  // Fields set in PGM_RSRC1 pm4 packet.
+  const MCExpr *VGPRBlocks = nullptr;
+  const MCExpr *SGPRBlocks = nullptr;
+  uint32_t Priority = 0;
+  uint32_t FloatMode = 0;
+  uint32_t Priv = 0;
+  uint32_t DX10Clamp = 0;
+  uint32_t DebugMode = 0;
+  uint32_t IEEEMode = 0;
+  uint32_t WgpMode = 0;    // GFX10+
+  uint32_t MemOrdered = 0; // GFX10+
+  uint32_t RrWgMode = 0;   // GFX12+
+  const MCExpr *ScratchSize = nullptr;
+
+  // State used to calculate fields set in PGM_RSRC2 pm4 packet.
+  uint32_t LDSBlocks = 0;
+  const MCExpr *ScratchBlocks = nullptr;
+
+  // Fields set in PGM_RSRC2 pm4 packet
+  const MCExpr *ScratchEnable = nullptr;
+  uint32_t UserSGPR = 0;
+  uint32_t TrapHandlerEnable = 0;
+  uint32_t TGIdXEnable = 0;
+  uint32_t TGIdYEnable = 0;
+  uint32_t TGIdZEnable = 0;
+  uint32_t TGSizeEnable = 0;
+  uint32_t TIdIGCompCount = 0;
+  uint32_t EXCPEnMSB = 0;
+  uint32_t LdsSize = 0;
+  uint32_t EXCPEnable = 0;
+
+  const MCExpr *ComputePGMRSrc3GFX90A = nullptr;
+
+  const MCExpr *NumVGPR = nullptr;
+  const MCExpr *NumArchVGPR = nullptr;
+  const MCExpr *NumAccVGPR = nullptr;
+  const MCExpr *AccumOffset = nullptr;
+  uint32_t TgSplit = 0;
+  const MCExpr *NumSGPR = nullptr;
+  unsigned SGPRSpill = 0;
+  unsigned VGPRSpill = 0;
+  uint32_t LDSSize = 0;
+  const MCExpr *FlatUsed = nullptr;
+
+  // Number of SGPRs that meets number of waves per execution unit request.
+  const MCExpr *NumSGPRsForWavesPerEU = nullptr;
+
+  // Number of VGPRs that meets number of waves per execution unit request.
+  const MCExpr *NumVGPRsForWavesPerEU = nullptr;
+
+  // Final occupancy.
+  const MCExpr *Occupancy = nullptr;
+
+  // Whether there is recursion, dynamic allocas, indirect calls or some other
+  // reason there may be statically unknown stack usage.
+  const MCExpr *DynamicCallStack = nullptr;
+
+  // Bonus information for debugging.
+  const MCExpr *VCCUsed = nullptr;
+
+  SIProgramInfo() = default;
+
+  // The constructor sets the values for each member as shown in the struct.
+  // However, setting the MCExpr members to their zero value equivalent
+  // happens in reset together with (duplicated) value re-set for the
+  // non-MCExpr members.
+  void reset(const MachineFunction &MF);
+
+  /// Compute the value of the ComputePGMRsrc1 register.
+  uint64_t getComputePGMRSrc1(const GCNSubtarget &ST) const;
+  uint64_t getPGMRSrc1(CallingConv::ID CC, const GCNSubtarget &ST) const;
+  const MCExpr *getComputePGMRSrc1(const GCNSubtarget &ST,
+                                   MCContext &Ctx) const;
+  const MCExpr *getPGMRSrc1(CallingConv::ID CC, const GCNSubtarget &ST,
+                            MCContext &Ctx) const;
+
+  /// Compute the value of the ComputePGMRsrc2 register.
+  uint64_t getComputePGMRSrc2() const;
+  uint64_t getPGMRSrc2(CallingConv::ID CC) const;
+  const MCExpr *getComputePGMRSrc2(MCContext &Ctx) const;
+  const MCExpr *getPGMRSrc2(CallingConv::ID CC, MCContext &Ctx) const;
 };
 
 } // namespace llvm

``````````

</details>


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


More information about the llvm-commits mailing list