From 8fb8b094410149ded85464499cd27fc197c90dce Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 16 May 2025 17:58:06 -0700 Subject: [PATCH] [Scalar] Avoid creating temporary instances of std::string (NFC) ExprLinearizer::write takes StringRef and immediately sends the content to the stream without hanging onto the pointer, so we do not need to create temporary instances of std::string. --- llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp index 1aceb5098eafb..56d4be513ea6f 100644 --- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp +++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp @@ -2446,10 +2446,10 @@ class LowerMatrixIntrinsics { return; } else { Ops.append(I->value_op_begin(), I->value_op_end()); - write(std::string(I->getOpcodeName())); + write(I->getOpcodeName()); } - write(std::string("(")); + write("("); unsigned NumOpsToBreak = 1; if (match(Expr, m_Intrinsic()))