From bcbb032d557db28b221ac0b1992413de2b653454 Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Thu, 26 Jul 2018 00:02:54 +0000 Subject: [PATCH] [MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve. Summary: InstrDesc contains 4 vectors (as well as some other data), so it's expensive to copy. Authored By: orodley Reviewers: andreadb, mattd, dberris Reviewed By: mattd, dberris Subscribers: dberris, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D49775 llvm-svn: 337985 --- llvm/tools/llvm-mca/LSUnit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/tools/llvm-mca/LSUnit.cpp b/llvm/tools/llvm-mca/LSUnit.cpp index 4406e30..9ee3b61 100644 --- a/llvm/tools/llvm-mca/LSUnit.cpp +++ b/llvm/tools/llvm-mca/LSUnit.cpp @@ -52,7 +52,7 @@ void LSUnit::assignSQSlot(unsigned Index) { } bool LSUnit::reserve(const InstRef &IR) { - const InstrDesc Desc = IR.getInstruction()->getDesc(); + const InstrDesc &Desc = IR.getInstruction()->getDesc(); unsigned MayLoad = Desc.MayLoad; unsigned MayStore = Desc.MayStore; unsigned IsMemBarrier = Desc.HasSideEffects; -- 2.7.4