[llvm] [AMDGPU] Replace some uses of raw_svector_ostream with Twine. NFC. (PR #137627)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 07:53:21 PDT 2025
================
@@ -261,11 +261,8 @@ void AMDGPUPALMetadata::setEntryPoint(unsigned CC, StringRef Name) {
// Set .entry_point which is defined
// to be _amdgpu_<stage> and _amdgpu_cs for non-shader functions
- SmallString<16> EPName("_amdgpu_");
- raw_svector_ostream EPNameOS(EPName);
- EPNameOS << getStageName(CC) + 1;
- getHwStage(CC)[".entry_point"] =
- MsgPackDoc.getNode(EPNameOS.str(), /*Copy=*/true);
+ getHwStage(CC)[".entry_point"] = MsgPackDoc.getNode(
+ (Twine("_amdgpu_") + getStageName(CC).drop_front()).str(), /*Copy=*/true);
----------------
LU-JOHN wrote:
FWIW, I feel like the new code is more readable.
https://github.com/llvm/llvm-project/pull/137627
More information about the llvm-commits
mailing list