summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineSink.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid splitting critical edge twice for a set of PHI uses.Evan Cheng2010-09-201-17/+23
| | | | llvm-svn: 114338
* Fix code that break critical edges for PHI uses. Watch out for multiple PHIs ↵Evan Cheng2010-09-181-71/+66
| | | | | | in different blocks. llvm-svn: 114270
* Teach machine sink toEvan Cheng2010-09-171-68/+218
| | | | | | | | | | 1) Do forward copy propagation. This makes it easier to estimate the cost of the instruction being sunk. 2) Break critical edges on demand, including cases where the value is used by PHI nodes. Critical edge splitting is not yet enabled by default. llvm-svn: 114227
* Update debug logs.Evan Cheng2010-08-191-4/+4
| | | | llvm-svn: 111575
* It's possible to sink a def if its local uses are PHI's.Evan Cheng2010-08-191-5/+5
| | | | llvm-svn: 111537
* Remove disabled assertion.Evan Cheng2010-08-191-2/+0
| | | | llvm-svn: 111531
* Teach machine-sink to break critical edges when appropriate. Work in progress.Evan Cheng2010-08-191-8/+99
| | | | llvm-svn: 111530
* If any def of a machine-sink candidate has local uses, it's obviously not ↵Evan Cheng2010-08-181-5/+18
| | | | | | safe to sink it to a successor block. This bug has been hidden because a later check for critical-edge disable these illegal optimizations. This patch should significantly reduce the amount of time spent on checking dominator information for obviously unsafe sinking. llvm-svn: 111450
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+2
| | | | llvm-svn: 109045
* - Reapply r106066 now that the bzip2 build regression has been fixed.Bill Wendling2010-06-251-50/+10
| | | | | | - 2010-06-25-CoalescerSubRegDefDead.ll is the testcase for r106878. llvm-svn: 106880
* Revert r106066, "Create a more targeted fix for not sinking instructions ↵Daniel Dunbar2010-06-231-14/+53
| | | | | | | | | | into a range where it"... it causes bzip2 to be miscompiled by Clang. Conflicts: lib/CodeGen/MachineSink.cpp llvm-svn: 106614
* Improve comment to include that the use of a preg is also verboten in this ↵Bill Wendling2010-06-161-3/+4
| | | | | | situation. llvm-svn: 106119
* Create a more targeted fix for not sinking instructions into a range where itBill Wendling2010-06-151-50/+10
| | | | | | | | will conflict with another live range. The place which creates this scenerio is the code in X86 that lowers a select instruction by splitting the MBBs. This eliminates the need to check from the bottom up in an MBB for live pregs. llvm-svn: 106066
* Cleanup 80-column and trim trailing whitespaceJim Grosbach2010-06-031-33/+33
| | | | llvm-svn: 105435
* Machine sink could potentially sink instructions into a block where the physicalBill Wendling2010-06-031-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | registers it defines then interfere with an existing preg live range. For instance, if we had something like these machine instructions: BB#0 ... = imul ... EFLAGS<imp-def,dead> test ..., EFLAGS<imp-def> jcc BB#2 EFLAGS<imp-use> BB#1 ... ; fallthrough to BB#2 BB#2 ... ; No code that defines EFLAGS jcc ... EFLAGS<imp-use> Machine sink will come along, see that imul implicitly defines EFLAGS, but because it's "dead", it assumes that it can move imul into BB#2. But when it does, imul's "dead" imp-def of EFLAGS is raised from the dead (a zombie) and messes up the condition code for the jump (and pretty much anything else which relies upon it being correct). The solution is to know which pregs are live going into a basic block. However, that information isn't calculated at this point. Nor does the LiveVariables pass take into account non-allocatable physical registers. In lieu of this, we do a *very* conservative pass through the basic block to determine if a preg is live coming out of it. llvm-svn: 105387
* Compulsive reformating. No functionalitical changes.Bill Wendling2010-06-021-11/+19
| | | | llvm-svn: 105359
* Teach MachineLICM and MachineSink how to clear kill flags conservativelyDan Gohman2010-05-131-0/+5
| | | | | | when they move instructions. llvm-svn: 103737
* Avoid sinking machine instructions into a loop.Jakob Stoklund Olesen2010-04-151-0/+11
| | | | | | | | | | MachineLoopInfo is already available when MachineSinking runs, so the check is free. There is no test case because it would require a critical edge into a loop, and CodeGenPrepare splits those. This check is just to be extra careful. llvm-svn: 101420
* Teach MachineSinking to handle easy critical edges.Jakob Stoklund Olesen2010-04-131-2/+17
| | | | | | | | | | | | | | Sometimes it is desirable to sink instructions along a critical edge: x = ... if (a && b) ... else use(x); The 'a && b' condition creates a critical edge to the else block, but we still want to sink the computation of x into the block. The else block is dominated by the parent block, so we are not pushing instructions into new code paths. llvm-svn: 101165
* Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.Dan Gohman2010-04-051-0/+5
| | | | llvm-svn: 100455
* Fix some more places where dbg_value affected codegen.Dale Johannesen2010-03-051-3/+11
| | | | llvm-svn: 97765
* Swap parameters of isSafeToMove and isSafeToReMat for consistency.Evan Cheng2010-03-021-1/+1
| | | | llvm-svn: 97578
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-3/+2
| | | | | | | | | 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. llvm-svn: 95687
* Change errs() to dbgs().David Greene2010-01-051-4/+4
| | | | llvm-svn: 92593
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Fix a typo in a comment.Dan Gohman2009-10-191-1/+1
| | | | llvm-svn: 84504
* Change a few instance variables to be local variables.Dan Gohman2009-10-191-11/+6
| | | | llvm-svn: 84503
* Factor out LiveIntervalAnalysis' code to determine whether an instructionDan Gohman2009-10-091-1/+5
| | | | | | | | | | | | | | is trivially rematerializable and integrate it into TargetInstrInfo::isTriviallyReMaterializable. This way, all places that need to know whether an instruction is rematerializable will get the same answer. This enables the useful parts of the aggressive-remat option by default -- using AliasAnalysis to determine whether a memory location is invariant, and removes the questionable parts -- rematting operations with virtual register inputs that may not be live everywhere. llvm-svn: 83687
* Replace TargetInstrInfo::isInvariantLoad and its target-specificDan Gohman2009-10-071-2/+0
| | | | | | | | | implementations with a new MachineInstr::isInvariantLoad, which uses MachineMemOperands and is target-independent. This brings MachineLICM and other functionality to targets which previously lacked an isInvariantLoad implementation. llvm-svn: 83475
* Don't hoist or sink instructions with physreg uses if the physreg isDan Gohman2009-09-261-3/+12
| | | | | | | allocatable. Even if it doesn't appear to have any defs, it may latter on after register allocation. llvm-svn: 82834
* Fix MachineSink to be able to sink instructions that use physical registersDan Gohman2009-09-251-1/+14
| | | | | | | | which have no defs anywhere in the function. In particular, this fixes sinking of instructions that reference RIP on x86-64, which is currently being modeled as a register. llvm-svn: 82815
* Simplify this code by using use_iterator instead of reg_iteratorDan Gohman2009-09-251-4/+2
| | | | | | and skipping the defs. llvm-svn: 82811
* remove std::ostream versions of printing stuff for MBB and MF,Chris Lattner2009-08-231-3/+3
| | | | | | upgrading a few things to use raw_ostream llvm-svn: 79811
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-221-1/+2
| | | | llvm-svn: 79755
* Various comment fixes.Dan Gohman2009-08-051-3/+8
| | | | llvm-svn: 78139
* Use setPreservesAll and setPreservesCFG in CodeGen passes.Dan Gohman2009-07-311-0/+1
| | | | llvm-svn: 77754
* fix two problems with machine sinking:Chris Lattner2009-04-101-12/+26
| | | | | | | | | | | 1. Sinking would crash when the first instruction of a block was sunk due to iterator problems. 2. Instructions could be sunk to their current block, causing an infinite loop. This fixes PR3968 llvm-svn: 68787
* Fix PR3522. It's not safe to sink into landing pad BB's.Evan Cheng2009-02-151-0/+5
| | | | llvm-svn: 64582
* Don't sink the instruction if TargetRegisterInfo::isSafeToMoveRegClassDefs ↵Evan Cheng2009-02-071-0/+4
| | | | | | doesn't think it's safe. This works around PR1911. llvm-svn: 63994
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+0
| | | | llvm-svn: 61715
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-1/+1
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Remove isImm(), isReg(), and friends, in favor of Dan Gohman2008-09-131-1/+1
| | | | | | | | | isImmediate(), isRegister(), and friends, to avoid confusion about having two different names with the same meaning. I'm not attached to the longer names, and would be ok with changing to the shorter names if others prefer it. llvm-svn: 56189
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-3/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Refactor some code out of MachineSink into a MachineInstr query.Evan Cheng2008-03-131-23/+2
| | | | llvm-svn: 48311
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-3/+4
| | | | llvm-svn: 46930
OpenPOWER on IntegriCloud