aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* unssa: track uses when replacing a phi nodeKamil Dudka2009-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello, attached are patch, testing input for test-unssa and its outputs before patch and after patch. Thanks in advance for considering the patch! Kamil test: .L0x7f9fb2030010 <entry-point> phisrc.32 %phi2(ptr) <- %arg1 br .L0x7f9fb2030130 .L0x7f9fb2030130 copy.32 %r1(ptr) <- %r5(ptr) br %r1(ptr), .L0x7f9fb2030058, .L0x7f9fb20300e8 .L0x7f9fb2030058 load.32 %r3 <- 0[%r1(ptr)] phisrc.32 %phi3(ptr) <- %r3 br .L0x7f9fb2030130 .L0x7f9fb20300e8 ret test: .L0x7f4a7f7f1010 <entry-point> copy.32 %r5(ptr) <- %arg1 br .L0x7f4a7f7f1130 .L0x7f4a7f7f1130 copy.32 %r1(ptr) <- %r5(ptr) br %r1(ptr), .L0x7f4a7f7f1058, .L0x7f4a7f7f10e8 .L0x7f4a7f7f1058 load.32 %r3 <- 0[%r1(ptr)] copy.32 %r5(ptr) <- %r3 br .L0x7f4a7f7f1130 .L0x7f4a7f7f10e8 ret >From 66a02fa7cec780fc88d6ef4cce7a1e704928808a Mon Sep 17 00:00:00 2001 From: Kamil Dudka <kdudka@redhat.com> Date: Sun, 9 Aug 2009 10:22:11 +0200 Subject: [PATCH] unssa: track uses when replacing a phi node The output of test-unssa is inconsistent for a simple test-case without this patch: static void test(void **ptr) { while (ptr) { ptr = *ptr; } } Signed-off-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
* Remove totally bogus phi-source liveness thing.Linus Torvalds2005-11-201-13/+0
| | | | | | | Thanks to Luc Van Oostenryck for pointing out a trivial example of something that does totally the wrong thing with that code. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Add compile-time "range-check" infrastructure to sparseLinus Torvalds2005-04-071-0/+4
|
* Split OP_CAST into signed, unsigned and FP casts.Linus Torvalds2005-04-071-0/+2
| | | | | Otherwise we lose the information what the target type is (we only have the bit-size of the target).
* Split OP_SETVAL into OP_SETVAL (fp expressions and labels) and OP_SYMADDRLinus Torvalds2005-04-071-0/+4
| | | | | | | (symbol addresses). They are pretty different. Symbol addresses have special meaning during various phases, from symbol simplification to CSE.
* Make asm linearization not drop the constraints.Linus Torvalds2005-04-071-7/+16
| | | | | This also makes the OP_ASM data structures a bit more structured in order to contain all the required information.
* Remove pseudos from liveness list when they are defined.Linus Torvalds2005-04-071-0/+14
| | | | | This only matters for phi-nodes, since other kinds of pseudos should never see any use before their def anyway.
* Track phi uses in a separate pass from the liveness analysis.Linus Torvalds2005-04-071-2/+13
| | | | We'll want to have the full phi user list when we do liveness.
* PHI pseudos aren't supposed to show up on the livenessLinus Torvalds2005-04-071-1/+1
| | | | tracking. Make the asserts reflect that.
* Move remove_pseudo() to linearize.hLinus Torvalds2005-04-071-5/+0
|
* Oops. When updatign the liveness calculation, I forgot toLinus Torvalds2005-04-071-8/+6
| | | | | | | update the code that moves "needs" information to the parent. Now that we only add real needs to the needs list, this is much simpler.
* Fix liveness analysis.Linus Torvalds2005-04-071-10/+5
| | | | | | | | | Let's not add the pseudos that the bb defines internally onto the "needs" list. Rather than removign them later, just avoid putting them there in the first place. The special cases end up being argument pseudos (which aren't really defined by the entry bb) and phi-nodes.
* Make OP_PHISOURCE track the OP_PHI instructions that it defines.Linus Torvalds2005-04-071-1/+16
| | | | | | | | This allows us to always see which pseudos are nonlocally affected by the phi source. We can only do this after the instruction flow is fixed, together with the OP_DEATHNOTE phase.
* Teach liveness analysis about asm pseudo usage.Linus Torvalds2005-04-071-0/+10
|
* Track argument pseudo lifetimes too.Linus Torvalds2005-04-071-14/+2
| | | | | This requires that we be able to handle "uses" pseudos without a defining instruction.
* Add pseudo death-note tracking.Linus Torvalds2005-04-071-58/+124
| | | | | | | | | | 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.
* Walk the basic-block list in reverse order for liveness analysisLinus Torvalds2005-04-071-2/+2
| | | | | | (this approximates depth-first) rather than in-order (~breadth first). This hugely speeds up long chains pseudo use.
* Remove OP_SETCC, make OP_SEL bigger instead.Linus Torvalds2005-04-071-6/+1
| | | | | | | This was originally done so that "struct instruction" would be smaller, but it has since grown anyway (for the memops), so splitting OP_SEL into two instructions no longer makes sense, and makes it harder on CSE.
* Do real flow simplification only after liveness analysis.Linus Torvalds2005-04-071-1/+19
| | | | | | | | | | 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.
* After doing liveness analysis, remove purely internal defs from def list.Linus Torvalds2005-04-071-0/+16
| | | | | The bb register usage lists are now just the minimal set of pseudos that are relevant for parents/children.
* Simplify trivial casts (and handle pointers specially).Linus Torvalds2005-04-071-0/+1
| | | | | | | | | | | | This does trivial simplification of casting to the same typesize. HOWEVER. We split casts up into whether they cast to a dereferencable pointer type or not, and we don't simplify pointer casts. This should mean that if we ever want to do type-based alias analysis, we can still avoid casted accesses. (If we do type-based alias analysis, we'll also need to make a union access do a cast. Which we probably should do anyway).
* Rename "register.c" into "liveness.c". That's what it does.Linus Torvalds2005-04-071-0/+234