1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/unittests
Daniel Sanders 99f8a8b118 [globalisel] Introduce LegalityQuery to better encapsulate the legalizer decisions. NFC.
Summary:
`getAction(const InstrAspect &) const` breaks encapsulation by exposing
the smaller components that are used to decide how to legalize an
instruction.

This is a problem because we need to change the implementation of
LegalizerInfo so that it's able to describe particular type combinations
rather than just cartesian products of types.

For example, declaring the following
  setAction({..., 0, s32}, Legal)
  setAction({..., 0, s64}, Legal)
  setAction({..., 1, s32}, Legal)
  setAction({..., 1, s64}, Legal)
currently declares these type combinations as legal:
  {s32, s32}
  {s64, s32}
  {s32, s64}
  {s64, s64}
but we currently have no means to say that, for example, {s64, s32} is
not legal. Some operations such as G_INSERT/G_EXTRACT/G_MERGE_VALUES/
G_UNMERGE_VALUES has relationships between the types that are currently
described incorrectly.

Additionally, G_LOAD/G_STORE currently have no means to legalize non-atomics
differently to atomics. The necessary information is in the MMO but we have no
way to use this in the legalizer. Similarly, there is currently no way for the
register type and the memory type to differ so there is no way to cleanly
represent extending-load/truncating-store in a way that can't be broken by
optimizers (resulting in illegal MIR).

This patch introduces LegalityQuery which provides all the information
needed by the legalizer to make a decision on whether something is legal
and how to legalize it.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar, volkan, reames, bogner

Reviewed By: bogner

Subscribers: bogner, llvm-commits, kristof.beyls

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

llvm-svn: 323342
2018-01-24 17:17:46 +00:00
..
ADT Fix typos of occurred and occurrence 2018-01-24 10:33:39 +00:00
Analysis [SCEV] Do not cache S -> V if S is not equivalent of V 2018-01-09 06:47:14 +00:00
AsmParser
BinaryFormat [BinaryFormat] Fix out of bounds read. 2017-08-31 12:50:42 +00:00
Bitcode Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
CodeGen [globalisel] Introduce LegalityQuery to better encapsulate the legalizer decisions. NFC. 2018-01-24 17:17:46 +00:00
DebugInfo [MSF] Fix FPM interval calcluation 2018-01-05 18:12:14 +00:00
ExecutionEngine [ORC] Add orc::SymbolResolver, a Orc/Legacy API interop header, and an 2018-01-22 03:00:31 +00:00
FuzzMutate [FuzzMutate] Avoid using swifterror as a source operand 2018-01-11 14:43:05 +00:00
IR [Metadata] Extend 'count' field of DISubrange to take a metadata node 2018-01-24 09:56:07 +00:00
LineEditor
Linker Fix build for LLVM unittests 2017-09-15 21:12:13 +00:00
MC Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MI Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
Object Fix unittest for buildbot with mips host (32bit big endian) from r295174 2017-02-15 16:03:22 +00:00
ObjectYAML
Option [Option] For typo '-foo', suggest '--foo' 2018-01-09 19:38:04 +00:00
ProfileData Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
Support [YAML] Plain scalars can not begin with most indicators. 2018-01-22 10:20:48 +00:00
Target Reapply "[GlobalISel] Remove the GISelAccessor API." 2017-08-15 22:31:51 +00:00
tools [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Transforms Add tests for ConstantFoldTerminator preserving DomTree 2018-01-17 16:27:17 +00:00
XRay [XRay][graph] Disambiguate name of type from member name 2017-02-10 06:59:25 +00:00
CMakeLists.txt Reland 'Classify llvm-cfi-verify.' 2017-10-11 20:35:01 +00:00