mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
23f0c22225
This patch adds the ability to identify instructions that are "move elimination candidates". It also allows scheduling models to describe processor register files that allow move elimination. A move elimination candidate is an instruction that can be eliminated at register renaming stage. Each subtarget can specify which instructions are move elimination candidates with the help of tablegen class "IsOptimizableRegisterMove" (see llvm/Target/TargetInstrPredicate.td). For example, on X86, BtVer2 allows both GPR and MMX/SSE moves to be eliminated. The definition of 'IsOptimizableRegisterMove' for BtVer2 looks like this: ``` def : IsOptimizableRegisterMove<[ InstructionEquivalenceClass<[ // GPR variants. MOV32rr, MOV64rr, // MMX variants. MMX_MOVQ64rr, // SSE variants. MOVAPSrr, MOVUPSrr, MOVAPDrr, MOVUPDrr, MOVDQArr, MOVDQUrr, // AVX variants. VMOVAPSrr, VMOVUPSrr, VMOVAPDrr, VMOVUPDrr, VMOVDQArr, VMOVDQUrr ], CheckNot<CheckSameRegOperand<0, 1>> > ]>; ``` Definitions of IsOptimizableRegisterMove from processor models of a same Target are processed by the SubtargetEmitter to auto-generate a target-specific override for each of the following predicate methods: ``` bool TargetSubtargetInfo::isOptimizableRegisterMove(const MachineInstr *MI) const; bool MCInstrAnalysis::isOptimizableRegisterMove(const MCInst &MI, unsigned CPUID) const; ``` By default, those methods return false (i.e. conservatively assume that there are no move elimination candidates). Tablegen class RegisterFile has been extended with the following information: - The set of register classes that allow move elimination. - Maxium number of moves that can be eliminated every cycle. - Whether move elimination is restricted to moves from registers that are known to be zero. This patch is structured in three part: A first part (which is mostly boilerplate) adds the new 'isOptimizableRegisterMove' target hooks, and extends existing register file descriptors in MC by introducing new fields to describe properties related to move elimination. A second part, uses the new tablegen constructs to describe move elimination in the BtVer2 scheduling model. A third part, teaches llm-mca how to query the new 'isOptimizableRegisterMove' hook to mark instructions that are candidates for move elimination. It also teaches class RegisterFile how to describe constraints on move elimination at PRF granularity. llvm-mca tests for btver2 show differences before/after this patch. Differential Revision: https://reviews.llvm.org/D53134 llvm-svn: 344334 |
||
---|---|---|
.. | ||
benchmark | ||
bugpoint | ||
count | ||
crosstool | ||
docker | ||
emacs | ||
FileCheck | ||
fpcmp | ||
gdb-scripts | ||
git | ||
git-svn | ||
jedit | ||
kate | ||
KillTheDoctor | ||
lint | ||
lit | ||
llvm-build | ||
llvm-lit | ||
LLVMVisualizers | ||
Misc | ||
not | ||
PerfectShuffle | ||
release | ||
Reviewing | ||
sanitizers | ||
TableGen | ||
Target/ARM | ||
testgen | ||
textmate | ||
unittest | ||
UpdateTestChecks | ||
valgrind | ||
vim | ||
vscode | ||
yaml-bench | ||
abtest.py | ||
bisect | ||
bisect-skip-count | ||
bugpoint_gisel_reducer.py | ||
check-each-file | ||
clang-parse-diagnostics-file | ||
codegen-diff | ||
countloc.sh | ||
create_ladder_graph.py | ||
demangle_tree.py | ||
DSAclean.py | ||
DSAextract.py | ||
extract_symbols.py | ||
findmisopt | ||
findoptdiff | ||
findsym.pl | ||
GenLibDeps.pl | ||
GetRepositoryPath | ||
GetSourceVersion | ||
getsrcs.sh | ||
indirect_calls.py | ||
lldbDataFormatters.py | ||
llvm-compilers-check | ||
llvm-gisel-cov.py | ||
llvm-native-gxx | ||
llvm.grm | ||
LLVMBuild.txt | ||
llvmdo | ||
llvmgrep | ||
prepare-code-coverage-artifact.py | ||
schedcover.py | ||
shuffle_fuzz.py | ||
shuffle_select_fuzz_tester.py | ||
sort_includes.py | ||
unicode-case-fold.py | ||
update_analyze_test_checks.py | ||
update_cc_test_checks.py | ||
update_llc_test_checks.py | ||
update_mca_test_checks.py | ||
update_mir_test_checks.py | ||
update_test_checks.py | ||
UpdateCMakeLists.pl | ||
wciia.py |