llvm-project/llvm/test/CodeGen
Daniel Sanders f84bc3793e [globalisel] Update GlobalISel emitter to match new representation of extending loads
Summary:
Previously, a extending load was represented at (G_*EXT (G_LOAD x)).
This had a few drawbacks:
* G_LOAD had to be legal for all sizes you could extend from, even if
  registers didn't naturally hold those sizes.
* All sizes you could extend from had to be allocatable just in case the
  extend went missing (e.g. by optimization).
* At minimum, G_*EXT and G_TRUNC had to be legal for these sizes. As we
  improve optimization of extends and truncates, this legality requirement
  would spread without considerable care w.r.t when certain combines were
  permitted.
* The SelectionDAG importer required some ugly and fragile pattern
  rewriting to translate patterns into this style.

This patch changes the representation to:
* (G_[SZ]EXTLOAD x)
* (G_LOAD x) any-extends when MMO.getSize() * 8 < ResultTy.getSizeInBits()
which resolves these issues by allowing targets to work entirely in their
native register sizes, and by having a more direct translation from
SelectionDAG patterns.

Each extending load can be lowered by the legalizer into separate extends
and loads, however a target that supports s1 will need the any-extending
load to extend to at least s8 since LLVM does not represent memory accesses
smaller than 8 bit. The legalizer can widenScalar G_LOAD into an
any-extending load but sign/zero-extending loads need help from something
else like a combiner pass. A follow-up patch that adds combiner helpers for
for this will follow.

The new representation requires that the MMO correctly reflect the memory
access so this has been corrected in a couple tests. I've also moved the
extending loads to their own tests since they are (mostly) separate opcodes
now. Additionally, the re-write appears to have invalidated two tests from
select-with-no-legality-check.mir since the matcher table no longer contains
loads that result in s1's and they aren't legal in AArch64 anymore.

Depends on D45540

Reviewers: ab, aditya_nandakumar, bogner, rtereshin, volkan, rovka, javed.absar

Reviewed By: rtereshin

Subscribers: javed.absar, llvm-commits, kristof.beyls

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

llvm-svn: 331601
2018-05-05 20:53:24 +00:00
..
AArch64 [globalisel] Update GlobalISel emitter to match new representation of extending loads 2018-05-05 20:53:24 +00:00
AMDGPU AMDGPU: Add D16 instructions preserve unused bits feature 2018-05-04 20:06:57 +00:00
ARC
ARM ARM: don't try to over-align large vectors as arguments. 2018-05-03 12:54:25 +00:00
AVR [AVR] Add a regression test for struct return lowering 2018-03-20 11:23:03 +00:00
BPF bpf: fix incorrect SELECT_CC lowering 2018-04-03 03:56:37 +00:00
Generic Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
Hexagon [Hexagon] Handle non-immediate constants in HexagonSplitDouble 2018-05-04 15:04:48 +00:00
Inputs
Lanai
MIR [MIRPraser] Improve error checking for typed immediate operands 2018-05-05 20:53:23 +00:00
MSP430
Mips Reland r331175: "[mips] Fix the predicates of jump and branch and link instructions" 2018-05-01 13:06:49 +00:00
NVPTX [NVPTX] Make the legalizer expand shufflevector of <2 x half> 2018-04-26 15:26:29 +00:00
Nios2
PowerPC Fast Math Flag mapping into SDNode 2018-05-04 18:48:20 +00:00
RISCV [RISCV] Add remat.ll test case 2018-04-27 11:50:30 +00:00
SPARC [DAGCombiner] Set the right SDLoc on a newly-created zextload (1/N) 2018-05-01 19:26:15 +00:00
SystemZ [RegUsageInfoCollector] Bugfix for handling of register aliases. 2018-05-04 07:50:05 +00:00
Thumb Reapply ARM: Do not spill CSR to stack on entry to noreturn functions 2018-04-07 10:57:03 +00:00
Thumb2 MachO: trap unreachable instructions 2018-04-13 22:25:20 +00:00
WebAssembly [DAGCombiner] Fix a case of 1 in non-splat vector pow2 divisor 2018-04-27 22:23:11 +00:00
WinCFGuard
WinEH
X86 [DAGCombiner] Masked merge: don't touch "not" xor's. 2018-05-05 15:45:40 +00:00
XCore Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00