1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

91 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
f61ad513fc Verify kill flags conservatively.
Allow a live range to end with a kill flag, but don't allow a kill flag that
doesn't end the live range.

This makes the machine code verifier more useful during register allocation when
kill flag computation is deferred.

llvm-svn: 124838
2011-02-04 00:39:18 +00:00
Jakob Stoklund Olesen
c1a042a528 Verify slot index ordering.
The slot indexes must be monotonically increasing through the function.

llvm-svn: 123324
2011-01-12 21:27:48 +00:00
Jakob Stoklund Olesen
764cce86f0 Verify that machine instruction parent pointers are consistent.
llvm-svn: 123322
2011-01-12 21:27:41 +00:00
Jakob Stoklund Olesen
ed53ab1635 Replace TargetRegisterInfo::printReg with a PrintReg class that also works without a TRI instance.
Print virtual registers numbered from 0 instead of the arbitrary
FirstVirtualRegister. The first virtual register is printed as %vreg0.
TRI::NoRegister is printed as %noreg.

llvm-svn: 123107
2011-01-09 03:05:53 +00:00
Jakob Stoklund Olesen
b04c78d5ea Fix a MachineVerifier loop that probably didn't mean to skip the last two
virtual registers.

llvm-svn: 123100
2011-01-08 23:11:02 +00:00
Cameron Zwarich
0fa638e27c Simplify some code in MachineVerifier that was doing the correct thing, but not
in the most obvious way.

llvm-svn: 122610
2010-12-28 23:45:38 +00:00
Cameron Zwarich
66289e34e1 Add knowledge of phi-def and phi-kill valnos to MachineVerifier's predecessor
valno verification. The "Different value live out of predecessor" check is
incorrect in the case of phi-def valnos, so just skip that check for phi-def
valnos and instead check that all of the valnos for predecessors have phi-kill.
Fixes PR8863.

llvm-svn: 122581
2010-12-27 05:17:23 +00:00
Cameron Zwarich
ad29bd5325 MachineVerifier should count landing pad successors as basic blocks rather than
out-edges. Fixes PR8824.

llvm-svn: 122228
2010-12-20 04:19:48 +00:00
Cameron Zwarich
6970ec515e Teach MachineVerifier that early clobber defs begin at USE slots and other defs
begin at DEF slots. Fixes the second half of PR8813.

llvm-svn: 122225
2010-12-20 03:15:20 +00:00
Cameron Zwarich
31af86ef44 Add a missing check from r122218.
llvm-svn: 122224
2010-12-20 02:59:51 +00:00
Cameron Zwarich
bcd02fd9a4 Don't assume that an instruction ending a register's live range always reads
the register; it may be a dead def instead. Fixes PR8820.

llvm-svn: 122218
2010-12-20 01:22:37 +00:00
Cameron Zwarich
8c00d690f5 Ignore debug values when performing MachineVerifier liveness checks. Fixes
PR8822.

llvm-svn: 122207
2010-12-20 00:08:10 +00:00
Cameron Zwarich
c8dfbe7503 Early clobber operands are allowed to be defined at use indices. This fixes one
half of PR8813.

llvm-svn: 122205
2010-12-19 23:50:53 +00:00
Cameron Zwarich
37aec9c35d Fix PR8811 by teaching MachineVerifier about optional defs.
llvm-svn: 122199
2010-12-19 21:37:23 +00:00
Jakob Stoklund Olesen
2879da5e13 Pass a Banner argument to the machine code verifier both from
createMachineVerifierPass and MachineFunction::verify.

The banner is printed before the machine code dump, just like the printer pass.

llvm-svn: 122113
2010-12-18 00:06:56 +00:00
Jakob Stoklund Olesen
0dc90e6b1b Allow missing kill flags on an untied operand of a two-address instruction when
the operand uses the same register as a tied operand:

  %r1 = add %r1, %r1

If add were a three-address instruction, kill flags would be required on at
least one of the uses. Since it is a two-address instruction, the tied use
operand must not have a kill flag.

This change makes the kill flag on the untied use operand optional.

llvm-svn: 122082
2010-12-17 19:18:41 +00:00
Eric Christopher
fb840882c6 Only avoid the check if we're the last operand before the variable
operands in a variadic instruction.

llvm-svn: 119446
2010-11-17 00:55:36 +00:00
Eric Christopher
954db96e84 Make the verifier a little quieter on instructions that it's probably
(and likely) wrong about anyhow.

llvm-svn: 119320
2010-11-16 01:58:21 +00:00
Jakob Stoklund Olesen
b0f64b3d2b Be more precise about verifying missing kill flags.
It is legal for an instruction to have two operands using the same register,
only one a kill. This is interpreted as a kill.

llvm-svn: 117981
2010-11-01 23:59:53 +00:00
Jakob Stoklund Olesen
0ed56c87e4 Add kill flag verification.
At least X86FloatingPoint requires correct kill flags after register allocation,
and targets using register scavenging benefit. Conservative kill flags are not
enough.

llvm-svn: 117960
2010-11-01 21:51:31 +00:00
Jakob Stoklund Olesen
b4a55702b7 Add basic LiveStacks verification.
When an instruction refers to a spill slot with a LiveStacks entry, check that
the spill slot is live at the instruction.

llvm-svn: 117944
2010-11-01 19:49:52 +00:00
Jakob Stoklund Olesen
b751dffc9f Disable more of physical register live intervals verification.
llvm-svn: 117762
2010-10-30 01:26:11 +00:00
Jakob Stoklund Olesen
1210a5145a Print out the connected components in the verifier after complaining about their
multiplicity.

llvm-svn: 117630
2010-10-29 00:40:57 +00:00
Jakob Stoklund Olesen
c570151dc2 One day, physical register live ranges will be sensible.
llvm-svn: 117602
2010-10-28 20:44:22 +00:00
Jakob Stoklund Olesen
4701c56446 Physical registers trivially have multiple connected components all the time.
Only virtuals should be requires to be connected.

llvm-svn: 117422
2010-10-27 00:39:01 +00:00
Jakob Stoklund Olesen
3bf3211458 Verify that live intervals are connected. If there are multiple connected
components, each should get its own virtual register.

llvm-svn: 117407
2010-10-26 22:36:07 +00:00
Jakob Stoklund Olesen
3a4c0c13eb Teach MachineBasicBlock::print() to annotate instructions and blocks with
SlotIndexes when available.

llvm-svn: 117392
2010-10-26 20:21:46 +00:00
Jakob Stoklund Olesen
195132633a Remmeber to print full live interval on verification error.
llvm-svn: 117391
2010-10-26 20:21:43 +00:00
Jakob Stoklund Olesen
de018e2d8e Don't verify physical registers going into landing pads.
Magic is happening that we don't understand.

llvm-svn: 117370
2010-10-26 16:49:23 +00:00
Jakob Stoklund Olesen
964f6a6be6 Verify LiveIntervals against the CFG, ensuring that live-in values are live-out
of all predecessors.

llvm-svn: 117191
2010-10-23 00:49:09 +00:00
Jakob Stoklund Olesen
c78f761faf Add more verification of LiveIntervals.
llvm-svn: 117170
2010-10-22 22:48:58 +00:00
Jakob Stoklund Olesen
82da267156 Permit landing pad successor blocks when verifying basic blocks that end in an
unconditional branch.

llvm-svn: 117041
2010-10-21 18:47:06 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Jakob Stoklund Olesen
3ad7d4262d Skip unused registers when verifying LiveIntervals.
llvm-svn: 115874
2010-10-06 23:54:35 +00:00
Jakob Stoklund Olesen
8371c85032 Stop using LiveRange in MachineVerifier.
llvm-svn: 115408
2010-10-02 05:24:46 +00:00
Owen Anderson
fe3d206e65 Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.
llvm-svn: 111815
2010-08-23 17:52:01 +00:00
Bill Wendling
33a73c2744 Correct header.
llvm-svn: 111540
2010-08-19 18:52:17 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Jakob Stoklund Olesen
819394ded8 Add more verification of LiveIntervals.
llvm-svn: 110454
2010-08-06 18:04:19 +00:00
Jakob Stoklund Olesen
26726984fe Don't try to verify LiveIntervals for physical registers.
When a physical register is in use, some alias of that register has a live
interval with a relevant live range. That is the sad state of intervals after
physreg coalescing of subregs, and it is good enough for correct register
allocation.

llvm-svn: 110452
2010-08-06 18:04:14 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Jakob Stoklund Olesen
1067cd1da0 Don't verify LiveVariables if LiveIntervals is available.
LiveVariables becomes horribly wrong while the coalescer is running, but the
analysis is not zapped until after the coalescer pass has run. This causes tons
of false reports when calling verify form the coalescer.

llvm-svn: 110402
2010-08-05 23:51:26 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Jakob Stoklund Olesen
2ea6a20c07 Add basic verification of LiveIntervals.
We verify that the LiveInterval is live at uses and defs, and that all
instructions have a SlotIndex.

Stuff we don't check yet:

- Is the LiveInterval minimal?
- Do all defs correspond to instructions or phis?
- Do all defs dominate all their live ranges?
- Are all live ranges continually reachable from their def?

llvm-svn: 110386
2010-08-05 22:32:21 +00:00
Jakob Stoklund Olesen
21e64c3fae Remove double-def checking from MachineVerifier, so a register does not have to
be killed before being redefined.

These checks are usually disabled, and usually fail when enabled. We de facto
allow live registers to be redefined without a kill, the corresponding
assertions in RegScavenger were removed long ago.

llvm-svn: 110362
2010-08-05 18:59:59 +00:00
Evan Cheng
b5fadc47e0 Allow ARM if-converter to be run after post allocation scheduling.
- This fixed a number of bugs in if-converter, tail merging, and post-allocation
  scheduler. If-converter now runs branch folding / tail merging first to
  maximize if-conversion opportunities.
- Also changed the t2IT instruction slightly. It now defines the ITSTATE
  register which is read by instructions in the IT block.
- Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't
  change the instruction ordering in the IT block (since IT mask has been
  finalized). It also ensures no other instructions can be scheduled between
  instructions in the IT block.

This is not yet enabled.

llvm-svn: 106344
2010-06-18 23:09:54 +00:00
Jakob Stoklund Olesen
76a5a71473 Teach the machine code verifier to use getSubRegisterRegClass().
The old approach was wrong. It had an off-by-one error.

llvm-svn: 104034
2010-05-18 17:31:12 +00:00
Jakob Stoklund Olesen
4715605740 When verifying two-address instructions, check the following:
- Kill is implicit when use and def registers are identical.
- Only virtual registers can differ.

Add a -verify-fast-regalloc to run the verifier before the fast allocator.

llvm-svn: 103797
2010-05-14 20:28:32 +00:00
Dan Gohman
d48633d340 Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00