fact "profitable" to do so. This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.
On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.
This concludes my head bashing against the bytecode format, at least for
now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10922 91177308-0d34-0410-b5e6-96231b3b80d8
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction. There is still a lot of room for improvement in the encoding
of the compaction table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10913 91177308-0d34-0410-b5e6-96231b3b80d8
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10911 91177308-0d34-0410-b5e6-96231b3b80d8
type planes. This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
dominates the normal destination, not the exceptional dest (ie, the result
of a call is undefined on an exception)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10841 91177308-0d34-0410-b5e6-96231b3b80d8
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not. This makes it
reasonable to add bcwriter specific stuff to it as necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10837 91177308-0d34-0410-b5e6-96231b3b80d8
testcase test/Regression/Assembler/ConstantExprFold.llx
Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP. By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.
It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10812 91177308-0d34-0410-b5e6-96231b3b80d8
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.
This _finally_ gets us to a place where we have a sane constant folder. The
rules are:
1. LLVM clients now use ConstantExpr::get* methods to fold constants. If they
cannot be folded, a constantexpr is created, so these methods always return
valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
ConstantFolding.h to try to fold constants. If they cannot be folded,
they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
has one client (Constants.cpp)
This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10807 91177308-0d34-0410-b5e6-96231b3b80d8
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10806 91177308-0d34-0410-b5e6-96231b3b80d8
The first change (which is disabled) compactifies all of the function constant
pools into the global constant pool, in an attempt to reduce the amount of
duplication and overhead. Unfortunately, as the comment indicates, this is
not yet a win, so it is disabled.
The second change sorts the typeid's so that those types that can be used
by instructions in the program appear earlier in the table than those that
cannot (such as structures and arrays). This causes the instructions to
be able to use the dense encoding more often, saving about 5K on 254.gap.
This is only a .65% savings though, unfortunately. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10754 91177308-0d34-0410-b5e6-96231b3b80d8
which never worked itself. The cee pass still doesn't work, but it doesn't use
this method anymore anyway, so eliminate the method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10302 91177308-0d34-0410-b5e6-96231b3b80d8
on the algorithm for directly computing immediate dominators presented in this
paper:
A Fast Algorithm for Finding Dominators in a Flowgraph
T. Lengauer & R. Tarjan, ACM TOPLAS July 1979, pgs 121-141.
This _substantially_ speeds up construction of all dominator related information.
Post-dominators to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10301 91177308-0d34-0410-b5e6-96231b3b80d8