[MachineCombiner] Support local strategy for traces
authorAnton Sidorenko <anton.sidorenko@syntacore.com>
Tue, 14 Feb 2023 10:32:10 +0000 (13:32 +0300)
committerAnton Sidorenko <anton.sidorenko@syntacore.com>
Fri, 17 Feb 2023 10:17:22 +0000 (13:17 +0300)
commit2693efa8a5bcd5196264c54f36f7fe6df6799420
tree193e5883be6504e21a3f2675fa15ae290eb30c62
parente6e0ba8d20b45e617d6680491bba16e5ed645207
[MachineCombiner] Support local strategy for traces

For in-order cores MachineCombiner makes better decisions when the critical path
is calculated only for the current basic block and does not take into account
other blocks from the trace.

This patch adds a virtual method to TargetInstrInfo to allow each target decide
which strategy to use.

Depends on D140541

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D140542
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/lib/CodeGen/MachineCombiner.cpp
llvm/lib/CodeGen/TargetInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.h
llvm/test/CodeGen/RISCV/machine-combiner-strategies.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/machine-combiner.ll