| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
..due to limited source sizes.
Yeah, should do this for left shifts too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
|
|
| |
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
|
|
| |
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
|
|
| |
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
|
|
|
|
| |
This patch address some of the dead instructions left in the usage chain.
Signed-Off-By: Christopher Li <sparse@chrisli.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current way of tracking pseudo register user is by
keeping a list of the address of the pseudo_t member.
This address can be in part of the instruction member, the
worse case is in the argument list of the call instruction.
As the comment for address_taken() said, using the container
to get instruction pointer is wrong. It use to work with instruction
that relate to symbol address. But that is not true any more. Even
worse, it is very hard to track the pseudo usage other than symbol
address. The only reason symbol address used to works for call instruction
is because call instruction did not directly use the symbol address.
I bit the bullet and just add the instruction pointer to pair with
the pseudo user pointer. So it will work with the case that the
user instruction is call as well.
Testing:
I compare the linearize result with/without the patch on a few
sparse source file it self. The linearize generate exactly
the same result except the symbol address changes. Which is
predictable different because the pseudo user structure allocate
memory.
Singed-Off-By: Christopher Li <sparse@chrisli.org>
|
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
|
|
| |
Constant casts, and some boolean ops with constants.
|
|
|
|
| |
Noted by Jeff Muizelaar
|
|
|
|
| |
error reporting.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Otherwise we lose the information what the target
type is (we only have the bit-size of the target).
|
|
|
|
| |
We can remove the cast if the AND made it unnecessary.
|
|
|
|
| |
instruction into account now that we have it.
|
|
|
|
|
|
|
| |
This is OP_MUL/OP_DIV/OP_MOD/OP_SHR.
We actually do the constant simplifications still wrong, but
now the information is all there.
|
|
|
|
| |
This should only happen for a buggy case anyway, but..
|
|
|
|
|
|
| |
Some day we migth do a type-based alias cast, and then we might do
something else, but for now simplification is better than leaving
them in and making analysis harder.
|
|
|
|
|
|
|
| |
(symbol addresses).
They are pretty different. Symbol addresses have special meaning during
various phases, from symbol simplification to CSE.
|
| |
|
|
|
|
|
|
|
| |
work.
Equality tests are commutative. The others aren't (well, they need
to switch the sense around).
|
| |
|
|
|
|
|
| |
This improves CSE, and simplifies code generation. Keep the
"simpler" argument in "src2".
|
|
|
|
|
|
|
|
| |
We can just replace all users with the symbol pseudo
directly.
This means that we can no longer re-do symbol simplification
after CSE, and we need to rely on the generic memop simplification.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
We should clear out "insn->cond" when turning it into
an unconditional branch, anything else will confuse us
later (kill_use() will set it to VOID, that's not good
enough).
Move it to simplify.c at the same time.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This means we find multiple cases faster, but more importantly,
it also means that if the chain is infinite, we can trivially
notice. We used to just notice immediate recursive uses, not the
more complex cases.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
It's a common idiom, keep it in common format.
|
|
|
|
| |
simplification phase.
|
|
|
|
|
|
|
| |
their own functions.
This makes ready for moving the OP_BR phi-following to
the instruction simplification phase.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
updates a variable where the only def is the update itself.
Testcase from Alexey Dobriyan
|
|
|
|
|
|
|
|
|
|
| |
We should drop symbol types by now, and base things on just raw
sizes. Anything else just doesn't work from a CSE standpoint.
Some things may care about actual types later, notably the type-
based alias analysis. Those types still exist in the cast nodes.
Also, make the printout be more readable.
|
|
|
|
|
|
| |
It will assrt if it can't find that many entries.
Zero means "all the ones you can find", aka old behaviour.
|
|
|
|
|
|
| |
node re-writing.
We'll want to do it for CSE too.
|
|
|
|
|
| |
Handle simple constant offsets and fold them into the
memop offset.
|
|
|
|
|
| |
We're much better at simplifying addition, so let's try to fix it
up.
|
| |
|
|
|
|
| |
has to agree on it or bad things happen.
|
|
|
|
|
|
|
|
| |
repeating CSE itself.
In particular, some symbol address simplifications imply that
we should repeat symbol simplification, since things may have
improved.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
are emptied, allowing us to kill yet more instructions.
This should get rid of a number of remaining orphan phi-source
instructions.
|
|
|
|
|
| |
We want to make sure that we kill them properly, so that
any pseudos they depended on or generated are also killed.
|