| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
Otherwise we lose the information what the target
type is (we only have the bit-size of the target).
|
|
|
|
|
|
|
| |
(symbol addresses).
They are pretty different. Symbol addresses have special meaning during
various phases, from symbol simplification to CSE.
|
|
|
|
|
| |
This also makes the OP_ASM data structures a bit more structured
in order to contain all the required information.
|
|
|
|
|
| |
This only matters for phi-nodes, since other kinds of pseudos
should never see any use before their def anyway.
|
|
|
|
| |
We'll want to have the full phi user list when we do liveness.
|
|
|
|
| |
tracking. Make the asserts reflect that.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This requires that we be able to handle "uses" pseudos without
a defining instruction.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
(this approximates depth-first) rather than in-order (~breadth first).
This hugely speeds up long chains pseudo use.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The bb register usage lists are now just the minimal set of pseudos
that are relevant for parents/children.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|