[llvm] r337985 - [MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve.

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 17:02:54 PDT 2018


Author: dberris
Date: Wed Jul 25 17:02:54 2018
New Revision: 337985

URL: http://llvm.org/viewvc/llvm-project?rev=337985&view=rev
Log:
[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

Modified:
    llvm/trunk/tools/llvm-mca/LSUnit.cpp

Modified: llvm/trunk/tools/llvm-mca/LSUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/LSUnit.cpp?rev=337985&r1=337984&r2=337985&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/LSUnit.cpp (original)
+++ llvm/trunk/tools/llvm-mca/LSUnit.cpp Wed Jul 25 17:02:54 2018
@@ -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;




More information about the llvm-commits mailing list