llvm-6502/test
Hal Finkel d281f1443a Consider subregs when calling MI::registerDefIsDead for phys deps
The scheduling dependency graph is built bottom-up within each scheduling
region, and ScheduleDAGInstrs::addPhysRegDeps is called to add output/anti
dependencies, based on physical registers, to the SUs for instructions
based on those that come before them.

In the test case, we start before post-RA scheduling with a block that looks
like this:

...
	INLINEASM <...
andc $0,$0,$2
stdcx. $0,0,$3
bne- 1b
> [sideeffect] [mayload] [maystore] [attdialect], $0:[regdef-ec:G8RC], %X6<earlyclobber,def,dead>, $1:[mem], %X3<kill>, $2:[reguse:G8RC], %X5<kill>, $3:[reguse:G8RC], %X3, $4:[mem], %X3, $5:[clobber], %CC<earlyclobber,imp-def,dead>, <<badref>>
	...
	%X4<def,dead> = ANDIo8 %X4<kill>, 1, %CR0<imp-def,dead>, %CR0GT<imp-def>
	...
	%R29<def> = ISEL %R3<undef>, %R4<kill>, %CR0GT<kill>

where it is relevant that %CC is an alias to %CR0, and that %CR0GT is a
subregister of %CR0. However, for post-RA scheduling, no dependency was added
to prevent the INLINEASM from being scheduled in between the ANDIo8 and the
ISEL (which communicate via the %CR0GT register).

In ScheduleDAGInstrs::addPhysRegDeps, when called for the %CC operand, we'd
iterate over all of its aliases (which include %CC itself and also %CR0), and
look for previously-encountered defs of those registers. We'd find the ANDIo8,
but decide not to add a dependency between the INLINEASM and the ANDIo8 because
both the INLINEASM's def of %CC is dead, and also the ANDIo8 def of %CR0 is
dead. This ignores, however, that ANDIo8 has a non-dead def of %CR0GT, a
subregister of %CR0, and thus a dependency still must exist.

To fix this problem, when calling registerDefIsDead on the SU with the def, we
also check all subregisters for possible non-dead defs, and add the dependency
if any are found.

Fixes PR21742.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223440 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 01:57:22 +00:00
..
Analysis Revert r222039 because of bot failure. 2014-11-19 00:13:26 +00:00
Assembler Use FileCheck in a few tests. 2014-11-06 15:05:51 +00:00
Bindings [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module. 2014-12-01 19:50:39 +00:00
Bitcode Parse 'ghccc' in .ll files as the GHC convention (cc 10) 2014-12-01 21:04:44 +00:00
BugPoint Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
CodeGen Consider subregs when calling MI::registerDefIsDead for phys deps 2014-12-05 01:57:22 +00:00
DebugInfo Add a comment. 2014-12-05 01:02:36 +00:00
ExecutionEngine Small model and JIT generally don't go well with each other. 2014-11-25 17:14:22 +00:00
Feature Prologue support 2014-12-03 02:08:38 +00:00
FileCheck
Instrumentation [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, llvm part 2014-12-03 23:28:26 +00:00
Integer
JitListener Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
Linker Add a few extra cases to the test. NFC. 2014-12-05 00:02:42 +00:00
LTO Add Forward Control-Flow Integrity. 2014-11-11 21:08:02 +00:00
MC Fix yet another unseen regression caused by r223113 2014-12-04 19:34:59 +00:00
Object Add missing test file 2014-12-04 09:20:13 +00:00
Other
SymbolRewriter Transform: add SymbolRewriter pass 2014-11-07 21:32:08 +00:00
TableGen
tools Re-add support to llvm-objdump for Mach-O universal files and archives with -macho 2014-12-04 23:56:27 +00:00
Transforms Add some tests for SimplifyCFG's TurnSwitchRangeIntoICmp(). NFC. 2014-12-04 22:19:28 +00:00
Unit
Verifier [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics 2014-12-01 21:18:12 +00:00
YAMLParser
.clang-format
CMakeLists.txt Revert "Add missing test dependency and use a more canonical target name." 2014-12-04 04:33:32 +00:00
lit.cfg [OCaml] [cmake] Add CMake buildsystem for OCaml. 2014-12-01 19:50:23 +00:00
lit.site.cfg.in [OCaml] [autoconf] Migrate to ocamlfind. 2014-10-30 08:29:45 +00:00
Makefile OCAMLFLAGS can contain =, don't use = with sed 2014-11-13 09:29:30 +00:00
Makefile.tests
TestRunner.sh