summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineVerifier.cpp
Commit message (Collapse)AuthorAge
* Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson2010-08-23
| | | | | | passes over to the new registration API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111815 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct header.Bill Wendling2010-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111540 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more verification of LiveIntervals.Jakob Stoklund Olesen2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110454 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to verify LiveIntervals for physical registers.Jakob Stoklund Olesen2010-08-06
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110452 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't verify LiveVariables if LiveIntervals is available.Jakob Stoklund Olesen2010-08-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110402 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic verification of LiveIntervals.Jakob Stoklund Olesen2010-08-05
| | | | | | | | | | | | | | 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? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110386 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove double-def checking from MachineVerifier, so a register does not have toJakob Stoklund Olesen2010-08-05
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110362 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow ARM if-converter to be run after post allocation scheduling.Evan Cheng2010-06-18
| | | | | | | | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106344 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the machine code verifier to use getSubRegisterRegClass().Jakob Stoklund Olesen2010-05-18
| | | | | | The old approach was wrong. It had an off-by-one error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104034 91177308-0d34-0410-b5e6-96231b3b80d8
* When verifying two-address instructions, check the following:Jakob Stoklund Olesen2010-05-14
| | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103797 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace polution.Dan Gohman2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate MachineBasicBlock::const_livein_iterator and makeDan Gohman2010-04-13
| | | | | | | | | MachineBasicBlock::livein_iterator a const_iterator, because clients shouldn't ever be using the iterator interface to mutate the livein set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101147 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-09
| | | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove livein checks from machine code verifier.Jakob Stoklund Olesen2010-01-05
| | | | | | | | | | | A phi operand that is implicitly defined in a predecessor becomes an undefined register after phi elimination. This causes a lot of false positives when the verifier is checking if live-in registers are live-out from all predecessors. Removing the verifier checks seems like a better solution than insisting on IMPLICIT_DEF instructions in predecessor blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92769 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove minimal CFG sanity checks from verifier.Jakob Stoklund Olesen2009-12-22
| | | | | | | | | These checks would often trigger on unreachable statements inserted by bugpoint, leading it astray. It would be nice if we could distinguish unreachable blocks from errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91923 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow explicit %reg0 operands beyond what the .td file describes.Jakob Stoklund Olesen2009-12-22
| | | | | | ARM uses these to indicate predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91922 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the target hook TargetInstrInfo::BlockHasNoFallThrough in favor ofDan Gohman2009-12-05
| | | | | | | | MachineBasicBlock::canFallThrough(), which is target-independent and more thorough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90634 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.Jakob Stoklund Olesen2009-11-20
| | | | | | Fix debug code that assumes getBasicBlock never returns NULL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89428 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the machine verifier to be run outside the PassManager.Jakob Stoklund Olesen2009-11-18
| | | | | | Verify LiveVariables information when present. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89241 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MachineFunction::verify() to call the machine code verifier directly.Jakob Stoklund Olesen2009-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88706 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix polarity of a CFG check in machine verifier.Jakob Stoklund Olesen2009-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88704 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -print-machineinstrs more readable.Dan Gohman2009-10-31
| | | | | | | | | | | | | | | - Be consistent when referring to MachineBasicBlocks: BB#0. - Be consistent when referring to virtual registers: %reg1024. - Be consistent when referring to unknown physical registers: %physreg10. - Be consistent when referring to known physical registers: %RAX - Be consistent when referring to register 0: %reg0 - Be consistent when printing alignments: align=16 - Print jump table contents. - Don't print host addresses, in general. - and various other cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85682 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-25
| | | | | | | VISIBILITY_HIDDEN removal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-25
| | | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few simple MachineVerifier checks for MachineMemOperands.Dan Gohman2009-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83474 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace and formatting.Jakob Stoklund Olesen2009-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83285 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix verification of explicit operands.Jakob Stoklund Olesen2009-09-23
| | | | | | | | | | The machine code verifier did not check for explicit operands correctly. It used MachineInstr::getNumExplicitOperands, but that method may cheat and use the declared count in the TargetInstrDesc. Now we check the explicit operands one at a time in visitMachineOperand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82652 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that phi instructions refer to MBBs in the CFG.Jakob Stoklund Olesen2009-09-21
| | | | | | | The machine code verifier no longer tolerates phi instructions with noop operands. All MBBs on a phi instruction must be in the CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82448 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the MachineBasicBlock verifier rules to be moreDan Gohman2009-08-27
| | | | | | | tolerant of blocks that end with "unreachable". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80270 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some checks for MachineCFG consistency. Use AnalyzeBranch andDan Gohman2009-08-27
| | | | | | | | do extra checking when it succeeds, as those are cases where CodeGen will be doing particularly interesting CFG modifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80196 91177308-0d34-0410-b5e6-96231b3b80d8
* remove various std::ostream version of printing methods fromChris Lattner2009-08-23
| | | | | | | | | MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
* remove std::ostream versions of printing stuff for MBB and MF,Chris Lattner2009-08-23
| | | | | | | upgrading a few things to use raw_ostream git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79811 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | instead of as two bools. Use this to add a F_Append flag which has the obvious behavior. Other unrelated changes conflated into this patch: 1. REmove EH stuff from llvm-dis and llvm-as, the try blocks are dead. 2. Simplify the filename inference code in llvm-as/llvm-dis, because raw_fd_ostream does the right thing with '-'. 3. Switch machine verifier to use raw_ostream instead of ostream (Which is the thing that needed append in the first place). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some dead print method variants.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79801 91177308-0d34-0410-b5e6-96231b3b80d8
* Use pristine register info in machine code verifier.Jakob Stoklund Olesen2009-08-13
| | | | | | So far these registers are simply tracked as if they were live-in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78912 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean out per-function data after the machine code verifier is done with it.Jakob Stoklund Olesen2009-08-08
| | | | | | | | | | | | | | | Also don't dereference old pointers after they have been deleted causing random crashes when enabling the machine code verifier. Ahem... I have not included a test case for the crash. It hapened when enabling the verifier on CodeGen/X86/2009-08-06-branchfolder-crash.ll. The crash depends on an MBB being allocated at the same address as a previously deleted MBB. I don't think that can be reproduced reliably. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78472 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the machine code verifier to keep up with the scavenger.Jakob Stoklund Olesen2009-08-08
| | | | | | | | | * Cleaner handling of <undef>. * <def> takes precedence over <def,dead>. * Implement the OK-to-redefine-a-register-that-was- live-in-but-has-not-been-used-before rule. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78467 91177308-0d34-0410-b5e6-96231b3b80d8
* Enforce stricter rules in machine code verifier.Jakob Stoklund Olesen2009-08-04
| | | | | | | | | | | Implicit operands no longer get a free pass: Imp-use requires a live register and imp-def requires a dead register. There is also no special rule allowing redefinition of a sub-register when the super-register is live. The super register must have imp-kill+imp-def operands instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78090 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle <undef> flag in machine code verifier.Jakob Stoklund Olesen2009-08-02
| | | | | | Use of an <undef> register is treated like an <imp-use>. It is not an error to use a dead <undef> register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77890 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman2009-07-31
| | | | | | | | | shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar2009-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77661 91177308-0d34-0410-b5e6-96231b3b80d8
* Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman2009-07-31
| | | | | | | | mechanism. To support this, make MachineFunctionPass a little more complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77654 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Introduce a new TargetOperandInfo::getRegClass() helper methodChris Lattner2009-07-29
| | | | | | | | | | | | | | | and convert code to using it, instead of having lots of things poke the isLookupPtrRegClass() method directly. 2. Make PointerLikeRegClass contain a 'kind' int, and store it in the existing regclass field of TargetOperandInfo when the isLookupPtrRegClass() predicate is set. Make getRegClass pass this into TargetRegisterInfo::getPointerRegClass(), allowing targets to have multiple ptr_rc things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77504 91177308-0d34-0410-b5e6-96231b3b80d8
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-25
| | | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that there is no kill flag on tied operands on two-address instructions.Jakob Stoklund Olesen2009-07-15
| | | | | | | | | | This extra check is not trigged when runnning "make check" on top-of-tree. Change error message to better match llvm_unreachable() grammar. Don't call llvm_unreachable() when writing error messages to a file, but keep going. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75860 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-11
| | | | | | | and abort()/exit() -> llvm_report_error(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8