From db834837c2645ed2f3df1e77aff6a4aa14d6980c Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Tue, 11 Sep 2018 18:47:48 +0000 Subject: [llvm-mca] Delay calculation of Cycles per Resources, separate the cycles and resource quantities. Summary: This patch removes the storing of accumulated floating point data within the llvm-mca library. This patch splits-up the two quantities: cycles and number of resource units. By splitting-up these two quantities, we delay the calculation of "cycles per resource unit" until that value is read, reducing the chance of accumulating floating point error. I considered using the APFloat, but after measuring performance, for a large (many iteration) sample, I decided to go with this faster solution. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: llvm-commits, javed.absar, tschuett, gbedwell Differential Revision: https://reviews.llvm.org/D51903 llvm-svn: 341980 --- llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h') diff --git a/llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h b/llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h index c3f893660eb..dfac15f53fc 100644 --- a/llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h +++ b/llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h @@ -17,6 +17,7 @@ #define LLVM_TOOLS_LLVM_MCA_RESOURCE_MANAGER_H #include "Instruction.h" +#include "Support.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" @@ -344,7 +345,7 @@ public: void issueInstruction( const InstrDesc &Desc, - llvm::SmallVectorImpl> &Pipes); + llvm::SmallVectorImpl> &Pipes); void cycleEvent(llvm::SmallVectorImpl &ResourcesFreed); -- cgit v1.2.3