[llvm] [CGData][GlobalIsel][Legalizer][DAG][MC][AsmParser][X86][AMX] Use `std::move` to avoid copy (PR #118068)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 23:09:09 PST 2024


================
@@ -6823,8 +6823,8 @@ SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
             ScalarOps.push_back(getUNDEF(OpVT));
             continue;
           }
-          APInt Val = cast<ConstantSDNode>(Op)->getAPIntValue();
-          ScalarOps.push_back(SignExtendInReg(Val, OpVT));
+          const APInt &Val = cast<ConstantSDNode>(Op)->getAPIntValue();
+          ScalarOps.push_back(SignExtendInReg(std::move(Val), OpVT));
----------------
topperc wrote:

I don't think you need the std::move now.

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


More information about the llvm-commits mailing list