llvm-project/llvm/test/CodeGen
Matthias Braun cebdb17522 LiveIntervalAnalysis: Fix alias regunit reserved definition
A register in CodeGen can be marked as reserved: In that case we
consider the register always live and do not use (or rather ignore)
kill/dead/undef operand flags.

LiveIntervalAnalysis however tracks liveness per register unit (not per
register). We already needed adjustments for this in r292871 to deal
with super/sub registers. However I did not look at aliased register
there. Looking at ARM:

FPSCR (regunits FPSCR, FPSCR~FPSCR_NZCV) aliases with FPSCR_NZCV
(regunits FPSCR_NZCV, FPSCR~FPSCR_NZCV) hence they share a register unit
(FPSCR~FPSCR_NZCV) that represents the aliased parts of the registers.
This shared register unit was previously considered non-reserved,
however given that we uses of the reserved FPSCR potentially violate
some rules (like uses without defs) we should make FPSCR~FPSCR_NZCV
reserved too and stop tracking liveness for it.

This patch:
- Defines a register unit as reserved when: At least for one root
  register, the root register and all its super registers are reserved.
- Adjust LiveIntervals::computeRegUnitRange() for new reserved
  definition.
- Add MachineRegisterInfo::isReservedRegUnit() to have a canonical way
  of testing.
- Stop computing LiveRanges for reserved register units in HMEditor even
  with UpdateFlags enabled.
- Skip verification of uses of reserved reg units in the machine
  verifier (this usually didn't happen because there would be no cached
  liverange but there is no guarantee for that and I would run into this
  case before the HMEditor tweak, so may as well fix the verifier too).

Note that this should only affect ARMs FPSCR/FPSCR_NZCV registers today;
aliased registers are rarely used, the only other cases are hexagons
P0-P3/P3_0 and C8/USR pairs which are not mixing reserved/non-reserved
registers in an alias.

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

llvm-svn: 312348
2017-09-01 18:36:26 +00:00
..
AArch64 [LoopVectorizer] Use two step casting for float to pointer types. 2017-09-01 15:36:00 +00:00
AMDGPU AMDGPU: IMPLICIT_DEFs and DBG_VALUEs do not contribute to wait states 2017-09-01 16:56:32 +00:00
ARC [ARC] Add ARC backend. 2017-08-24 15:40:33 +00:00
ARM LiveIntervalAnalysis: Fix alias regunit reserved definition 2017-09-01 18:36:26 +00:00
AVR [AVR] Use the correct register classes for 16-bit atomic operations 2017-08-24 00:14:38 +00:00
BPF Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
Generic [TargetPassConfig] Feature generic options to setup start/stop-after/before 2017-07-31 18:24:07 +00:00
Hexagon [Hexagon] Check for potential bank conflicts in post-RA scheduling 2017-08-28 18:36:21 +00:00
Inputs
Lanai
MIR [codeview] Generalize DIExpression parsing to handle load chains 2017-08-31 15:56:49 +00:00
MSP430 [DAG] Improve Aliasing of operations to static alloca 2017-07-18 20:06:24 +00:00
Mips Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding" 2017-09-01 14:27:20 +00:00
NVPTX Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
Nios2
PowerPC Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding" 2017-09-01 14:27:20 +00:00
SPARC Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding" 2017-09-01 14:27:20 +00:00
SystemZ [SystemZ, MachineScheduler] Improve post-RA scheduling. 2017-08-17 08:33:44 +00:00
Thumb Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding" 2017-09-01 14:27:20 +00:00
Thumb2 [ARM] Call setBooleanContents(ZeroOrOneBooleanContent) 2017-08-22 11:02:37 +00:00
WebAssembly [WebAssembly] Refactor load ISel tablegen patterns into classes 2017-08-31 21:51:48 +00:00
WinEH
X86 [X86] Add test case I forgot to commit with r312285. 2017-09-01 16:40:24 +00:00
XCore Delete Default and JITDefault code models 2017-08-03 02:16:21 +00:00