diff options
author | Chinmay Deshpande <chinmay1dd@gmail.com> | 2024-05-22 13:51:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 13:51:55 -0700 |
commit | 848bef5d8549cdc79bb0eb3c5a8e0495e432b577 (patch) | |
tree | 9ad3572a49bfffa1fbd715c9bef893b94f4acf68 /llvm/tools/llvm-mca/llvm-mca.cpp | |
parent | 25b65be43df56c1b7bea3fe2596fb36c2788d7af (diff) | |
download | llvm-848bef5d8549cdc79bb0eb3c5a8e0495e432b577.zip llvm-848bef5d8549cdc79bb0eb3c5a8e0495e432b577.tar.gz llvm-848bef5d8549cdc79bb0eb3c5a8e0495e432b577.tar.bz2 |
[llvm-mca] Add command line option -call-latency (#92958)
Currently we assume a constant latency of 100 cycles for call
instructions. This commit allows the user to specify a custom value for
the same as a command line argument. Default latency is set to 100.
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 03d7d79..cc5d4f5 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -135,6 +135,11 @@ static cl::opt<unsigned> "(instructions per cycle)"), cl::cat(ToolOptions), cl::init(0)); +static cl::opt<unsigned> + CallLatency("call-latency", cl::Hidden, + cl::desc("Number of cycles to assume for a call instruction"), + cl::cat(ToolOptions), cl::init(100U)); + enum class SkipType { NONE, LACK_SCHED, PARSE_FAILURE, ANY_FAILURE }; static cl::opt<enum SkipType> SkipUnsupportedInstructions( @@ -568,7 +573,7 @@ int main(int argc, char **argv) { } // Create an instruction builder. - mca::InstrBuilder IB(*STI, *MCII, *MRI, MCIA.get(), *IM); + mca::InstrBuilder IB(*STI, *MCII, *MRI, MCIA.get(), *IM, CallLatency); // Create a context to control ownership of the pipeline hardware. mca::Context MCA(*MRI, *STI); |