1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/lib/CodeGen/GlobalISel
Daniel Sanders f521e30212 [globalisel][tablegen] Generate rule coverage and use it to identify untested rules
Summary:
This patch adds a LLVM_ENABLE_GISEL_COV which, like LLVM_ENABLE_DAGISEL_COV,
causes TableGen to instrument the generated table to collect rule coverage
information. However, LLVM_ENABLE_GISEL_COV goes a bit further than
LLVM_ENABLE_DAGISEL_COV. The information is written to files
(${CMAKE_BINARY_DIR}/gisel-coverage-* by default). These files can then be
concatenated into ${LLVM_GISEL_COV_PREFIX}-all after which TableGen will
read this information and use it to emit warnings about untested rules.

This technique could also be used by SelectionDAG and can be further
extended to detect hot rules and give them priority over colder rules.

Usage:
* Enable LLVM_ENABLE_GISEL_COV in CMake
* Build the compiler and run some tests
* cat gisel-coverage-[0-9]* > gisel-coverage-all
* Delete lib/Target/*/*GenGlobalISel.inc*
* Build the compiler

Known issues:
* ${LLVM_GISEL_COV_PREFIX}-all must be generated as a manual
  step due to a lack of a portable 'cat' command. It should be the
  concatenation of all ${LLVM_GISEL_COV_PREFIX}-[0-9]* files.
* There's no mechanism to discard coverage information when the ruleset
  changes

Depends on D39742

Reviewers: ab, qcolombet, t.p.northover, aditya_nandakumar, rovka

Reviewed By: rovka

Subscribers: vsk, arsenm, nhaehnle, mgorny, kristof.beyls, javed.absar, igorb, llvm-commits

Differential Revision: https://reviews.llvm.org/D39747

llvm-svn: 318356
2017-11-16 00:46:35 +00:00
..
CallLowering.cpp [GISel]: Fix generation of illegal COPYs during CallLowering 2017-10-09 20:07:43 +00:00
CMakeLists.txt [GlobalISel] Remove a stall comment in CMake. 2017-08-04 20:15:41 +00:00
GlobalISel.cpp [GlobalISel] Make GlobalISel a non-optional library. 2017-08-03 21:52:25 +00:00
InstructionSelect.cpp [globalisel][tablegen] Generate rule coverage and use it to identify untested rules 2017-11-16 00:46:35 +00:00
InstructionSelector.cpp [globalisel][tablegen] Import signextload and zeroextload. 2017-11-11 03:23:44 +00:00
IRTranslator.cpp NFC Remove default argument of DataLayout::getPointerABIAlignment 2017-11-15 06:17:32 +00:00
Legalizer.cpp [GISel]: Rework legalization algorithm for better elimination of 2017-11-14 22:42:19 +00:00
LegalizerHelper.cpp [GlobalISel] Enable legalizing non-power-of-2 sized types. 2017-11-07 10:34:34 +00:00
LegalizerInfo.cpp Mark intentional fall-through with LLVM_FALLTHROUGH. 2017-11-07 13:31:52 +00:00
LLVMBuild.txt Revert "Get GlobalISel to build on Linux after r286407" 2016-11-16 22:24:59 +00:00
Localizer.cpp GlobalISel: stop localizer putting constants before EH_LABELs 2017-07-20 22:58:26 +00:00
MachineIRBuilder.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
RegBankSelect.cpp Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
RegisterBank.cpp Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
RegisterBankInfo.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
Utils.cpp [GISel][NFC]: Move getOpcodeDef from the LegalizationArtifactCombiner into GlobalISel/Utils for use elsewhere 2017-11-15 23:45:04 +00:00