aboutsummaryrefslogtreecommitdiff
path: root/flow.h
Commit message (Collapse)AuthorAgeFilesLines
* Add warning for accessing outside of a symbolLinus Torvalds2005-04-071-0/+1
| | | | | | | | This shows that we have some inlining bug where we seem to be corrupting the offsetting of an array. So right now the warnings we get in the kernel seem to be bogus, but this should help find that other bug too, and it doesn't trigger often enough to be too distracting.
* Add pseudo death-note tracking.Linus Torvalds2005-04-071-0/+2
| | | | | | | | | | Now that we have full pseudo usage lists, we can also add deathnotes to pseudos in the instruction stream. NOTE! We add the deathnote to _before_ the last instruction that uses that pseudo. That looks a bit strange, but it's actually what you want: when we traverse the instuctions, we want to know that the inputs are dead.
* Don't try to share parenthood fn between phi node removal and Linus Torvalds2005-04-071-3/+0
| | | | | | | | regular CSE. The CSE case is totally different: since both children use the same pseudos, there can be no question that a common parent wouldn't have that pseudo live.
* Do real flow simplification only after liveness analysis.Linus Torvalds2005-04-071-1/+5
| | | | | | | | | | The "constant conditional" stuff in flow simplification is now handled by the trivial instruction simplification, so the only thing that remained was the conditional flow based on following constant PHI-nodes. And that one can be much more effectively done after liveness analysis, when we can decide to skip even non-empty blocks if the target we are skipping to doesn't care about this particular block.
* Rename "register.c" into "liveness.c". That's what it does.Linus Torvalds2005-04-071-1/+1
|
* Add a flow verification thing.Linus Torvalds2005-04-071-0/+1
| | | | | Let's try to make sure that once I get these flow bugs ironed out they won't come creeping back in.
* Expose the "trivial common parent" logic that we use for phiLinus Torvalds2005-04-071-0/+3
| | | | | | node re-writing. We'll want to do it for CSE too.
* Add "memop" simplification phase.Linus Torvalds2005-04-071-0/+1
| | | | | | | | | | | It's a bit more simple-minded than the symbol simplification, and it can be more costly. So we start off with the (cheap) symbol simplification algorithm, and then use this new more generic phase later. This allows us to remove extra loads (and, in theory, stores, but the dead store elimination is so simple-minded right now that it's effectively useless).
* Expose "dominates()" function for memop domination checking.Linus Torvalds2005-04-071-0/+1
| | | | And rename the argument.
* Export the load instruction conversion functions.Linus Torvalds2005-04-071-0/+3
| | | | | | And clean up naming while at it ("insn" -> "instruction"). Shorthand is fine for local things, but when we expose them globally we're better off typing a few extra characters.
* Add a final pseudo usage tracking phase, which keepsLinus Torvalds2005-04-071-0/+2
| | | | | | | track of which instructions use which pseudos. It also verifies the usage, which shows a few bugs in structure handling.
* Make the CSE "repeat" logic be more fine-grained than justLinus Torvalds2005-04-071-0/+3
| | | | | | | | repeating CSE itself. In particular, some symbol address simplifications imply that we should repeat symbol simplification, since things may have improved.
* Handle killing of usage chains.Linus Torvalds2005-04-071-0/+1
| | | | | | | | When done carefully, this allows us to rewrite pseudo usage, as long as we make sure to fix up all the usage chains. In particular, we can now simplify memops and turn an access of a symbol through a pointer into a direct symbol access.
* Be more thorough about killing unreachable instructions.Linus Torvalds2005-04-071-0/+1
| | | | | We want to make sure that we kill them properly, so that any pseudos they depended on or generated are also killed.
* When killing a basic block, mark all its instructions unreachable.Linus Torvalds2005-04-071-0/+2
| | | | Also export "kill_bb()", since others want to use it too.
* Move instruction simplification to new file "simplify.c".Linus Torvalds2005-04-071-0/+1
| | | | | | | | | | Also, allow marking a pseudo unused by setting it to VOID, which just disables further renaming of that use. This is needed to make phi-source instructions (that can be shared among multiple phi-nodes thanks to CSE) be collectable. We used to just mark the phi source dead, but that was wrong, since _another_ phi node might be using it.
* Do "flow" simplification earlier (separate from packing).Linus Torvalds2005-04-071-1/+1
| | | | | This does branches-to-branches and trivial dead basicblock removal before CSE (so that CSE can do a better job).
* Make CSE convert instructions to OP_NOPLinus Torvalds2005-04-071-1/+1
| | | | | Instead of using the "convert_load_insn()" that converts them to OP_LNOP's, which ends up confusing instruction printout horribly.
* Add simple-stupid dominance testing for CSE.Linus Torvalds2005-04-071-0/+2
| | | | | | | | This makes us able to CSE stuff where one subexpression directly dominates another. But we still don't do any fancy code motion in the non- dominance case.
* Add initial CSE passLinus Torvalds2005-04-071-0/+3
| | | | | | | | It ain't very smart yet, but give it time. In particular, right now it gathers information for the whole function, but it only does the actual replacement if the instructions are in the same basic block.
* Move flow analysis out of "linearize.c" and into new "flow.c"Linus Torvalds2005-04-071-0/+8
Small files are good. Now "linearize" really just contains the code that does a straightforward linearization of the tree, and flow.c contains the stuff that tries to analyse the result.