aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-05-04SjLj EH could produce a machine basic block that legitimately has more than oneBill Wendling1-1/+9
landing pad as its successor. SjLj exception handling jumps to the correct landing pad via a switch statement that's generated right before code-gen. Loosen the constraint in the machine instruction verifier to allow for this. Note, this isn't the most rigorous check since we cannot determine where that switch statement came from. But it's marginally better than turning this check off when SjLj exceptions are used. <rdar://problem/9187612> llvm-svn: 130881
2011-04-05Permit blocks to branch directly to a landing pad.Jakob Stoklund Olesen1-0/+5
Treat the landing pad as a normal successor when that happens. llvm-svn: 128961
2011-03-31Allow kill flags on two-address instructions. They are harmless.Jakob Stoklund Olesen1-6/+2
llvm-svn: 128643
2011-03-31Mark all uses as <undef> when joining a copy.Jakob Stoklund Olesen1-5/+2
This way, shrinkToUses() will ignore the instruction that is about to be deleted, and we avoid leaving invalid live ranges that SplitKit doesn't like. Fix a misunderstanding in MachineVerifier about <def,undef> operands. The <undef> flag is valid on def operands where it has the same meaning as <undef> on a use operand. It only applies to sub-register defines which also read the full register. llvm-svn: 128642
2011-02-04Verify kill flags conservatively.Jakob Stoklund Olesen1-18/+5
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-01-12Verify slot index ordering.Jakob Stoklund Olesen1-0/+25
The slot indexes must be monotonically increasing through the function. llvm-svn: 123324
2011-01-12Verify that machine instruction parent pointers are consistent.Jakob Stoklund Olesen1-0/+5
llvm-svn: 123322
2011-01-09Replace TargetRegisterInfo::printReg with a PrintReg class that also works ↵Jakob Stoklund Olesen1-2/+2
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-08Fix a MachineVerifier loop that probably didn't mean to skip the last twoJakob Stoklund Olesen1-2/+2
virtual registers. llvm-svn: 123100
2010-12-28Simplify some code in MachineVerifier that was doing the correct thing, but notCameron Zwarich1-10/+11
in the most obvious way. llvm-svn: 122610
2010-12-27Add knowledge of phi-def and phi-kill valnos to MachineVerifier's predecessorCameron Zwarich1-1/+17
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-20MachineVerifier should count landing pad successors as basic blocks rather thanCameron Zwarich1-7/+9
out-edges. Fixes PR8824. llvm-svn: 122228
2010-12-20Teach MachineVerifier that early clobber defs begin at USE slots and other defsCameron Zwarich1-5/+26
begin at DEF slots. Fixes the second half of PR8813. llvm-svn: 122225
2010-12-20Add a missing check from r122218.Cameron Zwarich1-1/+1
llvm-svn: 122224
2010-12-20Don't assume that an instruction ending a register's live range always readsCameron Zwarich1-4/+18
the register; it may be a dead def instead. Fixes PR8820. llvm-svn: 122218
2010-12-20Ignore debug values when performing MachineVerifier liveness checks. FixesCameron Zwarich1-1/+3
PR8822. llvm-svn: 122207
2010-12-19Early clobber operands are allowed to be defined at use indices. This fixes oneCameron Zwarich1-1/+1
half of PR8813. llvm-svn: 122205
2010-12-19Fix PR8811 by teaching MachineVerifier about optional defs.Cameron Zwarich1-3/+3
llvm-svn: 122199
2010-12-18Pass a Banner argument to the machine code verifier both fromJakob Stoklund Olesen1-9/+16
createMachineVerifierPass and MachineFunction::verify. The banner is printed before the machine code dump, just like the printer pass. llvm-svn: 122113
2010-12-17Allow missing kill flags on an untied operand of a two-address instruction whenJakob Stoklund Olesen1-1/+6
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-11-17Only avoid the check if we're the last operand before the variableEric Christopher1-3/+3
operands in a variadic instruction. llvm-svn: 119446
2010-11-16Make the verifier a little quieter on instructions that it's probablyEric Christopher1-1/+3
(and likely) wrong about anyhow. llvm-svn: 119320
2010-11-01Be more precise about verifying missing kill flags.Jakob Stoklund Olesen1-2/+4
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-01Add kill flag verification.Jakob Stoklund Olesen1-2/+13
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-01Add basic LiveStacks verification.Jakob Stoklund Olesen1-0/+20
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-10-30Disable more of physical register live intervals verification.Jakob Stoklund Olesen1-2/+3
llvm-svn: 117762
2010-10-29Print out the connected components in the verifier after complaining about theirJakob Stoklund Olesen1-0/+8
multiplicity. llvm-svn: 117630
2010-10-28One day, physical register live ranges will be sensible.Jakob Stoklund Olesen1-0/+5
llvm-svn: 117602
2010-10-27Physical registers trivially have multiple connected components all the time.Jakob Stoklund Olesen1-5/+7
Only virtuals should be requires to be connected. llvm-svn: 117422
2010-10-26Verify that live intervals are connected. If there are multiple connectedJakob Stoklund Olesen1-1/+9
components, each should get its own virtual register. llvm-svn: 117407
2010-10-26Teach MachineBasicBlock::print() to annotate instructions and blocks withJakob Stoklund Olesen1-2/+11
SlotIndexes when available. llvm-svn: 117392
2010-10-26Remmeber to print full live interval on verification error.Jakob Stoklund Olesen1-4/+7
llvm-svn: 117391
2010-10-26Don't verify physical registers going into landing pads.Jakob Stoklund Olesen1-0/+8
Magic is happening that we don't understand. llvm-svn: 117370
2010-10-23Verify LiveIntervals against the CFG, ensuring that live-in values are live-outJakob Stoklund Olesen1-1/+77
of all predecessors. llvm-svn: 117191
2010-10-22Add more verification of LiveIntervals.Jakob Stoklund Olesen1-0/+29
llvm-svn: 117170
2010-10-21Permit landing pad successor blocks when verifying basic blocks that end in anJakob Stoklund Olesen1-5/+13
unconditional branch. llvm-svn: 117041
2010-10-19Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson1-1/+3
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-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-10-06Skip unused registers when verifying LiveIntervals.Jakob Stoklund Olesen1-0/+5
llvm-svn: 115874
2010-10-02Stop using LiveRange in MachineVerifier.Jakob Stoklund Olesen1-16/+15
llvm-svn: 115408
2010-08-23Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson1-3/+2
passes over to the new registration API. llvm-svn: 111815
2010-08-19Correct header.Bill Wendling1-1/+1
llvm-svn: 111540
2010-08-06Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson1-1/+1
llvm-svn: 110460
2010-08-06Add more verification of LiveIntervals.Jakob Stoklund Olesen1-4/+58
llvm-svn: 110454
2010-08-06Don't try to verify LiveIntervals for physical registers.Jakob Stoklund Olesen1-8/+4
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-06Revert r110396 to fix buildbots.Owen Anderson1-1/+1
llvm-svn: 110410
2010-08-05Don't verify LiveVariables if LiveIntervals is available.Jakob Stoklund Olesen1-12/+13
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-05Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson1-1/+1
address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
2010-08-05Add basic verification of LiveIntervals.Jakob Stoklund Olesen1-0/+59
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-05Remove double-def checking from MachineVerifier, so a register does not have toJakob Stoklund Olesen1-76/+11
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