summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Enforce stricter liveness rules for PHIs.Jakob Stoklund Olesen2012-06-251-6/+11
| | | | | | | | | | | | | Verify that all paths from the entry block to a virtual register read pass through a def. Enable this check even when MRI->isSSA() is false. Verify that the live range of a virtual register is live out of all predecessor blocks, even for PHI-values. This requires that PHIElimination sometimes inserts IMPLICIT_DEF instruction in predecessor blocks. llvm-svn: 159150
* Also verify the def index for early clobbers.Jakob Stoklund Olesen2012-06-221-2/+3
| | | | llvm-svn: 159039
* Fix some more LiveInterval enumerations.Jakob Stoklund Olesen2012-06-201-8/+9
| | | | | | Deterministically enumerate the virtual registers instead. llvm-svn: 158872
* Make machine verifier check the first instruction of the last bundle instead ofAkira Hatanaka2012-06-141-8/+8
| | | | | | the last instruction of a basic block. llvm-svn: 158468
* Move terminator machine verification to check ↵Pete Cooper2012-06-071-11/+11
| | | | | | MachineBasicBlock::instr_iterator instead of MBB::iterator llvm-svn: 158154
* Properly verify liveness with bundled machine instructions.Jakob Stoklund Olesen2012-06-061-13/+34
| | | | | | | | Bundles should be treated as one atomic transaction when checking liveness. That is how the register allocator (and VLIW targets) treats bundles. llvm-svn: 158116
* Switch all register list clients to the new MC*Iterator interface.Jakob Stoklund Olesen2012-06-011-9/+9
| | | | | | | | | | | | | No functional change intended. Sorry for the churn. The iterator classes are supposed to help avoid giant commits like this one in the future. The TableGen-produced register lists are getting quite large, and it may be necessary to change the table representation. This makes it possible to do so without changing all clients (again). llvm-svn: 157854
* Optional def can be either a def or a use (of reg0).Evan Cheng2012-05-291-1/+1
| | | | llvm-svn: 157640
* Fix a verifier bug.Jakob Stoklund Olesen2012-05-171-1/+1
| | | | | | Make sure useless (def-only) intervals also get verified. llvm-svn: 157000
* Add an MF argument to TRI::getPointerRegClass() and TII::getRegClass().Jakob Stoklund Olesen2012-05-071-3/+4
| | | | | | | | | | | | | The getPointerRegClass() hook can return register classes that depend on the calling convention of the current function (ptr_rc_tailcall). So far, we have been able to infer the calling convention from the subtarget alone, but as we add support for multiple calling conventions per target, that no longer works. Patch by Yiannis Tsiouris! llvm-svn: 156328
* Enable machine code verification after PreSched2 passes.Jakob Stoklund Olesen2012-03-281-1/+3
| | | | | | | | | | The late scheduler depends on accurate liveness information if it is breaking anti-dependencies, so we should be able to verify it. Relax the terminator checking in the machine code verifier so it can handle the basic blocks created by if conversion. llvm-svn: 153614
* Skip liveness verification when MRI->tracksLiveness() is false.Jakob Stoklund Olesen2012-03-281-105/+112
| | | | | | | | | Extract the liveness verification into its own method. This makes it possible to run the machine code verifier after liveness information is no longer required to be valid. llvm-svn: 153596
* Report the defining instruction.Jakob Stoklund Olesen2012-03-101-4/+3
| | | | llvm-svn: 152460
* Add SSA verification to MachineVerifier.Jakob Stoklund Olesen2012-03-101-2/+12
| | | | | | Somehow we never verified SSA dominance before. llvm-svn: 152458
* Use SmallPtrSet instead of DenseSet.Jakob Stoklund Olesen2012-03-101-3/+4
| | | | llvm-svn: 152457
* Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce ↵Craig Topper2012-03-051-4/+4
| | | | | | static data size. llvm-svn: 152016
* Move the operand iterator into MachineInstrBundle.h where it belongs.Jakob Stoklund Olesen2012-02-291-4/+5
| | | | | | | | | Extract a base class and provide four specific sub-classes for iterating over const/non-const bundles/instructions. This eliminates the mystery bool constructor argument. llvm-svn: 151684
* Handle regmasks in the machine code verifier.Jakob Stoklund Olesen2012-02-281-0/+15
| | | | llvm-svn: 151607
* Update machine code verifier.Jakob Stoklund Olesen2012-02-271-35/+91
| | | | | | | | | After the SlotIndex slot names were updated, it is possible to apply stricter checks to live intervals. Also treat bundles as bags of operands when checking live intervals. llvm-svn: 151531
* Update MachineVerifier to check the new physreg live-in rules.Lang Hames2012-02-141-0/+22
| | | | llvm-svn: 150496
* - Add MachineInstrBundle.h and MachineInstrBundle.cpp. This includes a functionEvan Cheng2011-12-141-2/+6
| | | | | | | | | | to finalize MI bundles (i.e. add BUNDLE instruction and computing register def and use lists of the BUNDLE instruction) and a pass to unpack bundles. - Teach more of MachineBasic and MachineInstr methods to be bundle aware. - Switch Thumb2 IT block to MI bundles and delete the hazard recognizer hack to prevent IT blocks from being broken apart. llvm-svn: 146542
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-14/+14
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* Remove all remaining uses of Value::getNameStr().Benjamin Kramer2011-11-151-1/+1
| | | | llvm-svn: 144648
* Use getVNInfoBefore() when it makes sense.Jakob Stoklund Olesen2011-11-141-3/+3
| | | | llvm-svn: 144517
* Rename SlotIndexes to match how they are used.Jakob Stoklund Olesen2011-11-131-9/+10
| | | | | | | | | | | | | | | | | | | | The old naming scheme (load/use/def/store) can be traced back to an old linear scan article, but the names don't match how slots are actually used. The load and store slots are not needed after the deferred spill code insertion framework was deleted. The use and def slots don't make any sense because we are using half-open intervals as is customary in C code, but the names suggest closed intervals. In reality, these slots were used to distinguish early-clobber defs from normal defs. The new naming scheme also has 4 slots, but the names match how the slots are really used. This is a purely mechanical renaming, but some of the code makes a lot more sense now. llvm-svn: 144503
* Fix sub-register operand verification.Jakob Stoklund Olesen2011-10-051-12/+25
| | | | | | | | | PhysReg operands are not allowed to have sub-register indices at all. For virtual registers with sub-reg indices, check that all registers in the register class support the sub-reg index. llvm-svn: 141220
* Verify that terminators follow non-terminators.Jakob Stoklund Olesen2011-09-231-0/+13
| | | | | | This exposes a -segmented-stacks bug. llvm-svn: 140429
* Lower ARM adds/subs to add/sub after adding optional CPSR operand.Andrew Trick2011-09-211-0/+3
| | | | | | | | | | | | | This is still a hack until we can teach tblgen to generate the optional CPSR operand rather than an implicit CPSR def. But the strangeness is now limited to the selection DAG. ADD/SUB MI's no longer have implicit CPSR defs, nor do we allow flag setting variants of these opcodes in machine code. There are several corner cases to consider, and getting one wrong would previously lead to nasty miscompilation. It's not the first time I've debugged one, so this time I added enough verification to ensure it won't happen again. llvm-svn: 140228
* Stop verifying hasPHIKill() flags.Jakob Stoklund Olesen2011-09-151-11/+1
| | | | | | | | | | There is only one legitimate use remaining, in addIntervalsForSpills(). All other calls to hasPHIKill() are only used to update PHIKill flags. The addIntervalsForSpills() function is part of the old spilling framework, only used by linearscan. llvm-svn: 139783
* Revert "Don't check liveness of unallocatable registers."Jakob Stoklund Olesen2011-07-301-9/+2
| | | | | | | The ARM target depends on CPSR liveness being tracked after register allocation. llvm-svn: 136548
* Don't check liveness of unallocatable registers.Jakob Stoklund Olesen2011-07-291-2/+9
| | | | | | | | | | | | This includes registers like EFLAGS and ST0-ST7. We don't check for liveness issues in the verifier and scavenger because registers will never be allocated from these classes. While in SSA form, we do care about the liveness of unallocatable unreserved registers. Liveness of EFLAGS and ST0 neds to be correct for MachineDCE and MachineSinking. llvm-svn: 136541
* Check for multiple defs in the machine code verifier.Jakob Stoklund Olesen2011-07-291-0/+5
| | | | llvm-svn: 136535
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-18/+19
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* More refactoring. Move getRegClass from TargetOperandInfo to TargetInstrInfo.Evan Cheng2011-06-271-4/+4
| | | | llvm-svn: 133944
* Use TRI::has{Sub,Super}ClassEq() where possible.Jakob Stoklund Olesen2011-06-021-1/+1
| | | | | | No functional change. llvm-svn: 132455
* Revert r128961 because it didn't include a test and causes the verifier to failCameron Zwarich2011-05-191-5/+0
| | | | | | | | on CodeGen/X86/2007-05-07-InvokeSRet.ll. There is probably a bug here that was fixed by r128961, but since there is no test or reference to a source file I have to revert it. llvm-svn: 131618
* SjLj EH could produce a machine basic block that legitimately has more than oneBill Wendling2011-05-041-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
* Permit blocks to branch directly to a landing pad.Jakob Stoklund Olesen2011-04-051-0/+5
| | | | | | Treat the landing pad as a normal successor when that happens. llvm-svn: 128961
* Allow kill flags on two-address instructions. They are harmless.Jakob Stoklund Olesen2011-03-311-6/+2
| | | | llvm-svn: 128643
* Mark all uses as <undef> when joining a copy.Jakob Stoklund Olesen2011-03-311-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
* Verify kill flags conservatively.Jakob Stoklund Olesen2011-02-041-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
* Verify slot index ordering.Jakob Stoklund Olesen2011-01-121-0/+25
| | | | | | The slot indexes must be monotonically increasing through the function. llvm-svn: 123324
* Verify that machine instruction parent pointers are consistent.Jakob Stoklund Olesen2011-01-121-0/+5
| | | | llvm-svn: 123322
* Replace TargetRegisterInfo::printReg with a PrintReg class that also works ↵Jakob Stoklund Olesen2011-01-091-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
* Fix a MachineVerifier loop that probably didn't mean to skip the last twoJakob Stoklund Olesen2011-01-081-2/+2
| | | | | | virtual registers. llvm-svn: 123100
* Simplify some code in MachineVerifier that was doing the correct thing, but notCameron Zwarich2010-12-281-10/+11
| | | | | | in the most obvious way. llvm-svn: 122610
* Add knowledge of phi-def and phi-kill valnos to MachineVerifier's predecessorCameron Zwarich2010-12-271-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
* MachineVerifier should count landing pad successors as basic blocks rather thanCameron Zwarich2010-12-201-7/+9
| | | | | | out-edges. Fixes PR8824. llvm-svn: 122228
* Teach MachineVerifier that early clobber defs begin at USE slots and other defsCameron Zwarich2010-12-201-5/+26
| | | | | | begin at DEF slots. Fixes the second half of PR8813. llvm-svn: 122225
* Add a missing check from r122218.Cameron Zwarich2010-12-201-1/+1
| | | | llvm-svn: 122224
OpenPOWER on IntegriCloud