Make IPSCCP strip off dead constant exprs that are using functions, making
them appear as though their address is taken. This allows us to propagate
some more pool descriptors, lowering the overhead of pool alloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21363 91177308-0d34-0410-b5e6-96231b3b80d8
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
if the other side is overdefined.
This allows us to fold conditions like: if (X < Y || Y > Z) in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18807 91177308-0d34-0410-b5e6-96231b3b80d8
1. Actually increment the Statistic for the GV elim optzn
2. When resolving undef branches, only resolve branches in executable blocks,
avoiding marking a bunch of completely dead blocks live. This has a big
impact on the quality of the generated code.
With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a
single memcpy call. In vortex we get this:
12 ipsccp - Number of globals found to be constant
986 ipsccp - Number of arguments constant propagated
1378 ipsccp - Number of basic blocks unreachable
8919 ipsccp - Number of instructions removed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18796 91177308-0d34-0410-b5e6-96231b3b80d8
In functions where we fully constant prop the return value, replace all
ret instructions with 'ret undef'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18786 91177308-0d34-0410-b5e6-96231b3b80d8
This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in
PR415), and does other nice things.
There is still more to come with this, but it's a start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18752 91177308-0d34-0410-b5e6-96231b3b80d8
1. Speedup getValueState by having it not consider Arguments. It's better
to just add them before we start SCCP'ing.
2. SCCP can delete the contents of dead blocks. No really, it's ok! This
reduces the size of the IR for subsequent passes, even though
simplifycfg would do the same job. In practice, simplifycfg does not
run until much later than sccp in gccas
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17820 91177308-0d34-0410-b5e6-96231b3b80d8
class. The only changes are minor:
* Do not try to SCCP instructions that return void in the rewrite loop.
This is silly and fool hardy, wasting a map lookup and adding an entry
to the map which is never used.
* If we decide something has an undefined value, rewrite it to undef,
potentially leading to further simplications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17816 91177308-0d34-0410-b5e6-96231b3b80d8
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
Speed up SCCP substantially by processing overdefined values quickly. This
patch speeds up SCCP by about 30-40% on large testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14861 91177308-0d34-0410-b5e6-96231b3b80d8
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12442 91177308-0d34-0410-b5e6-96231b3b80d8
constants as being "true" when evaluating branches. This was introduced
because we now create constantexprs for the constants instead of failing the
fold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10778 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
This allows us to fold expressions like "foo"[2], even if the pointer is only
a conditional constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10767 91177308-0d34-0410-b5e6-96231b3b80d8