1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib
Daniel Sanders 4cd719403f [globalisel][tablegen] Revise API for ComplexPattern operands to improve flexibility.
Summary:
Some targets need to be able to do more complex rendering than just adding an
operand or two to an instruction. For example, it may need to insert an
instruction to extract a subreg first, or it may need to perform an operation
on the operand.

In SelectionDAG, targets would create SDNode's to achieve the desired effect
during the complex pattern predicate. This worked because SelectionDAG had a
form of garbage collection that would take care of SDNode's that were created
but not used due to a later predicate rejecting a match. This doesn't translate
well to GlobalISel and the churn was wasteful.

The API changes in this patch enable GlobalISel to accomplish the same thing
without the waste. The API is now:
	InstructionSelector::OptionalComplexRendererFn selectArithImmed(MachineOperand &Root) const;
where Root is the root of the match. The return value can be omitted to
indicate that the predicate failed to match, or a function with the signature
ComplexRendererFn can be returned. For example:
	return OptionalComplexRendererFn(
	       [=](MachineInstrBuilder &MIB) { MIB.addImm(Immed).addImm(ShVal); });
adds two immediate operands to the rendered instruction. Immed and ShVal are
captured from the predicate function.

As an added bonus, this also reduces the amount of information we need to
provide to GIComplexOperandMatcher.

Depends on D31418

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

Reviewed By: ab

Subscribers: dberris, kristof.beyls, igorb, llvm-commits

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

llvm-svn: 301079
2017-04-22 15:11:04 +00:00
..
Analysis Remove a repeated comment line. NFC. 2017-04-21 23:12:16 +00:00
AsmParser Prefer addAttr(Attribute::AttrKind) over the AttributeList overload 2017-04-19 17:28:52 +00:00
Bitcode PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
CodeGen [globalisel][tablegen] Revise API for ComplexPattern operands to improve flexibility. 2017-04-22 15:11:04 +00:00
DebugInfo [DWARF] - Refactoring: localize handling of relocations in a single place. 2017-04-21 09:12:18 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine [APInt] Use lshrInPlace to replace lshr where possible 2017-04-18 17:14:21 +00:00
Fuzzer Fixup for r301054: Use an explicit constructor. 2017-04-21 23:28:01 +00:00
IR [AsmWriter] Eliminate warning. NFC 2017-04-21 06:14:38 +00:00
IRReader
LibDriver Fix some ArgList uses after API change in r300135. 2017-04-12 23:43:58 +00:00
LineEditor
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Object, LTO: Add target triple to irsymtab and LTO API. 2017-04-14 02:55:06 +00:00
MC Distinguish between code pointer size and DataLayout::getPointerSize() in DWARF info generation 2017-04-17 17:41:25 +00:00
Object [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-21 22:03:05 +00:00
ObjectYAML Add virtual destructor to WasmYAML::Section or avoid memory leak 2017-03-31 22:14:14 +00:00
Option ArgList: cache index ranges containing arguments with each ID 2017-04-12 23:19:51 +00:00
Passes MemorySSA: Move to Analysis, from Transforms/Utils. It's used as 2017-04-11 20:06:36 +00:00
ProfileData [ProfileData] Unify getInstrProf*SectionName helpers 2017-04-15 00:09:57 +00:00
Support [APInt] Add WORD_MAX constant and use it instead of UINT64_MAX. NFC 2017-04-22 06:31:36 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target [globalisel][tablegen] Revise API for ComplexPattern operands to improve flexibility. 2017-04-22 15:11:04 +00:00
Transforms Fix for PR32740 - Invalid floating type, unreachable between r300969 and r301029 2017-04-22 07:24:52 +00:00
XRay [XRay] - Fix spelling error to test commit access. 2017-04-06 03:32:01 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt