2019-10-03 21:13:39 +02:00
|
|
|
add_subdirectory(GlobalISel)
|
|
|
|
|
2011-11-02 06:03:06 +01:00
|
|
|
set(LLVM_LINK_COMPONENTS Support)
|
2010-10-17 04:26:16 +02:00
|
|
|
|
2011-10-06 03:51:51 +02:00
|
|
|
add_tablegen(llvm-tblgen LLVM
|
2009-07-11 23:53:14 +02:00
|
|
|
AsmMatcherEmitter.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
AsmWriterEmitter.cpp
|
2010-02-09 23:29:16 +01:00
|
|
|
AsmWriterInst.cpp
|
2015-11-11 21:35:42 +01:00
|
|
|
Attributes.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
CallingConvEmitter.cpp
|
|
|
|
CodeEmitterGen.cpp
|
|
|
|
CodeGenDAGPatterns.cpp
|
2017-09-14 18:56:21 +02:00
|
|
|
CodeGenHwModes.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
CodeGenInstruction.cpp
|
2012-10-25 17:57:56 +02:00
|
|
|
CodeGenMapTable.cpp
|
2011-06-09 20:42:07 +02:00
|
|
|
CodeGenRegisters.cpp
|
2012-07-07 06:00:00 +02:00
|
|
|
CodeGenSchedule.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
CodeGenTarget.cpp
|
|
|
|
DAGISelEmitter.cpp
|
2010-02-15 09:04:42 +01:00
|
|
|
DAGISelMatcherEmitter.cpp
|
|
|
|
DAGISelMatcherGen.cpp
|
2010-02-24 08:06:50 +01:00
|
|
|
DAGISelMatcherOpt.cpp
|
2010-02-15 09:04:42 +01:00
|
|
|
DAGISelMatcher.cpp
|
2019-10-04 11:03:36 +02:00
|
|
|
DFAEmitter.cpp
|
2011-12-01 22:53:39 +01:00
|
|
|
DFAPacketizerEmitter.cpp
|
2009-11-25 03:13:23 +01:00
|
|
|
DisassemblerEmitter.cpp
|
2018-10-25 09:44:01 +02:00
|
|
|
ExegesisEmitter.cpp
|
2009-03-16 18:04:14 +01:00
|
|
|
FastISelEmitter.cpp
|
2011-02-18 23:06:23 +01:00
|
|
|
FixedLenDecoderEmitter.cpp
|
2019-10-02 23:13:07 +02:00
|
|
|
GICombinerEmitter.cpp
|
2016-12-22 00:26:20 +01:00
|
|
|
GlobalISelEmitter.cpp
|
2017-09-14 18:56:21 +02:00
|
|
|
InfoByHwMode.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
InstrInfoEmitter.cpp
|
2017-11-14 16:35:15 +01:00
|
|
|
InstrDocsEmitter.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
IntrinsicEmitter.cpp
|
2012-12-05 01:29:32 +01:00
|
|
|
OptParserEmitter.cpp
|
2018-05-25 17:55:37 +02:00
|
|
|
PredicateExpander.cpp
|
2011-07-08 19:36:35 +02:00
|
|
|
PseudoLoweringEmitter.cpp
|
[RISCV] Tablegen-driven Instruction Compression.
Summary:
This patch implements a tablegen-driven Instruction Compression
mechanism for generating RISCV compressed instructions
(C Extension) from the expanded instruction form.
This tablegen backend processes CompressPat declarations in a
td file and generates all the compile-time and runtime checks
required to validate the declarations, validate the input
operands and generate correct instructions.
The checks include validating register operands, immediate
operands, fixed register operands and fixed immediate operands.
Example:
class CompressPat<dag input, dag output> {
dag Input = input;
dag Output = output;
list<Predicate> Predicates = [];
}
let Predicates = [HasStdExtC] in {
def : CompressPat<(ADD GPRNoX0:$rs1, GPRNoX0:$rs1, GPRNoX0:$rs2),
(C_ADD GPRNoX0:$rs1, GPRNoX0:$rs2)>;
}
The result is an auto-generated header file
'RISCVGenCompressEmitter.inc' which exports two functions for
compressing/uncompressing MCInst instructions, plus
some helper functions:
bool compressInst(MCInst& OutInst, const MCInst &MI,
const MCSubtargetInfo &STI,
MCContext &Context);
bool uncompressInst(MCInst& OutInst, const MCInst &MI,
const MCRegisterInfo &MRI,
const MCSubtargetInfo &STI);
The clients that include this auto-generated header file and
invoke these functions can compress an instruction before emitting
it, in the target-specific ASM or ELF streamer, or can uncompress
an instruction before printing it, when the expanded instruction
format aliases is favored.
The following clients were added to implement compression\uncompression
for RISCV:
1) RISCVAsmParser::MatchAndEmitInstruction:
Inserted a call to compressInst() to compresses instructions
parsed by llvm-mc coming from an ASM input.
2) RISCVAsmPrinter::EmitInstruction:
Inserted a call to compressInst() to compress instructions that
were lowered from Machine Instructions (MachineInstr).
3) RVInstPrinter::printInst:
Inserted a call to uncompressInst() to print the expanded
version of the instruction instead of the compressed one (e.g,
add s0, s0, a5 instead of c.add s0, a5) when -riscv-no-aliases
is not passed.
This patch squashes D45119, D42780 and D41932. It was reviewed in smaller patches by
asb, efriedma, apazos and mgrang.
Reviewers: asb, efriedma, apazos, llvm-commits, sabuasal
Reviewed By: sabuasal
Subscribers: mgorny, eraman, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, niosHD, kito-cheng, shiva0217, zzheng
Differential Revision: https://reviews.llvm.org/D45385
llvm-svn: 329455
2018-04-06 23:07:05 +02:00
|
|
|
RISCVCompressInstEmitter.cpp
|
Re-commit: [globalisel] Tablegen-erate current Register Bank Information
Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.
Changes since first commit attempt:
* Added missing guards
* Added more missing guards
* Found and fixed a use-after-free bug involving Twine locals
Reviewers: t.p.northover, ab, rovka, qcolombet
Reviewed By: qcolombet
Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka
Differential Revision: https://reviews.llvm.org/D27338
llvm-svn: 292478
2017-01-19 12:15:55 +01:00
|
|
|
RegisterBankEmitter.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
RegisterInfoEmitter.cpp
|
2017-12-20 20:36:28 +01:00
|
|
|
SDNodeProperties.cpp
|
2016-07-05 23:23:04 +02:00
|
|
|
SearchableTableEmitter.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
SubtargetEmitter.cpp
|
2016-11-15 10:51:02 +01:00
|
|
|
SubtargetFeatureInfo.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
TableGen.cpp
|
2016-11-19 13:21:34 +01:00
|
|
|
Types.cpp
|
2009-12-19 03:59:52 +01:00
|
|
|
X86DisassemblerTables.cpp
|
2017-03-07 09:11:19 +01:00
|
|
|
X86EVEX2VEXTablesEmitter.cpp
|
2017-10-08 11:20:32 +02:00
|
|
|
X86FoldTablesEmitter.cpp
|
2011-12-20 09:42:11 +01:00
|
|
|
X86ModRMFilters.cpp
|
2009-12-19 03:59:52 +01:00
|
|
|
X86RecognizableInstr.cpp
|
2018-05-11 00:16:44 +02:00
|
|
|
WebAssemblyDisassemblerEmitter.cpp
|
2013-03-22 00:40:38 +01:00
|
|
|
CTagsEmitter.cpp
|
2008-09-22 03:08:49 +02:00
|
|
|
)
|
2019-10-03 21:13:39 +02:00
|
|
|
target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenGlobalISel)
|
2017-11-04 21:07:16 +01:00
|
|
|
set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning")
|