From: Dean Michael Berris Date: Thu, 26 Jul 2018 00:02:54 +0000 (+0000) Subject: [MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12c27f5b5398e4f7aca5bf1cea997365a2ab58d8;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337985 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-mca/LSUnit.cpp b/tools/llvm-mca/LSUnit.cpp index 4406e30a593..9ee3b617189 100644 --- a/tools/llvm-mca/LSUnit.cpp +++ b/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;