From cbab7e65a720320c0478a2d15458d621bed2e81c Mon Sep 17 00:00:00 2001 From: Bruce Changlong Xu Date: Thu, 19 Mar 2026 15:16:47 -0700 Subject: [PATCH] [AMDGPU] Minor cleanups in offload plugin and AMDGPUEmitPrintf. NFC. (#187587) Use empty() in assert, brace-init instead of std::make_pair in the AMDGPU offload plugin, and fix a comment typo in AMDGPUEmitPrintf. --- llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp | 2 +- offload/plugins-nextgen/amdgpu/src/rtl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp b/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp index c52d62985677..04a2cda3cf44 100644 --- a/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp +++ b/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp @@ -475,7 +475,7 @@ Value *llvm::emitAMDGPUPrintfCall(IRBuilder<> &Builder, ArrayRef Args, Ptr = Builder.CreateConstInBoundsGEP1_32(Int8Ty, Ptr, 4); - // Create MD5 hash for costant format string, push low 64 bits of the + // Create MD5 hash for constant format string, push low 64 bits of the // same onto buffer and metadata. NamedMDNode *metaD = M->getOrInsertNamedMetadata("llvm.printf.fmts"); if (IsConstFmtStr) { diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp index b25d3c9ab721..3f9064eaf00b 100644 --- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp +++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp @@ -1141,7 +1141,7 @@ private: // Set the output signal of the current slot. Slots[Curr].Signal = OutputSignal; - return std::make_pair(Curr, InputSignal); + return {Curr, InputSignal}; } /// Complete all pending post actions and reset the stream after synchronizing @@ -1974,7 +1974,7 @@ struct AMDHostDeviceTy : public AMDGenericDeviceTy { const llvm::SmallVector &HostAgents) : AMDGenericDeviceTy(), Agents(HostAgents), ArgsMemoryManager(Plugin), PinnedMemoryManager(Plugin) { - assert(HostAgents.size() && "No host agent found"); + assert(!HostAgents.empty() && "No host agent found"); } /// Initialize the host device memory pools and the memory managers for