Commit Graph

5795 Commits

Author SHA1 Message Date
Chris Lattner
96ab5caf2d Switch to using edge profiling information as the basic source of profile info
from using basic block counts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 22:04:08 +00:00
Chris Lattner
62e84f376b Refactor implementations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12240 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 21:30:35 +00:00
Chris Lattner
6ba8972919 Import the trace class from the reoptimizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12236 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 20:57:27 +00:00
Chris Lattner
dbbbfef165 If we have edge counts, we can produce block counts. I've verified that
using an edge profile to produce block counts gives the exact same numbers
as using a block count directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12232 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 20:03:52 +00:00
Chris Lattner
9f717ef279 Adjust to new interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12231 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 18:51:45 +00:00
Chris Lattner
01945c1739 Add initial support for reading edge counts. This will be improved to enable
translation of edge counts into block/function counts when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12229 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 18:20:18 +00:00
Chris Lattner
b2f12a2c38 Initial support for edge profiling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 17:54:34 +00:00
Chris Lattner
467dd2ec61 Split utility functions out of BlockProfiling.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 17:06:13 +00:00
Chris Lattner
c51733c7b5 finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 16:45:53 +00:00
Chris Lattner
63a225050f Insert functions into the module promptly, not lazily. This fixes a bug
I introduced last night.  Note to self: test the *correct* tree...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 16:14:19 +00:00
Chris Lattner
802b5ab844 Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12218 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 06:17:35 +00:00
Chris Lattner
2c56b55cf0 Remove Module::mutateConstantPointerRef, which is now thankfully dead!
This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12216 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 06:16:10 +00:00
Chris Lattner
2296ec0ce9 Eliminate nightmarish API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 06:11:10 +00:00
Chris Lattner
bc2075977c Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 06:09:57 +00:00
Chris Lattner
d84d3501c6 Fix a bug handling globals that are constants, but are still external
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 03:52:24 +00:00
Chris Lattner
9b3c702614 Avoid allocating special registers a bit more robustly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12207 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 03:48:07 +00:00
Chris Lattner
7dee5daf85 Implement folding explicit load instructions into binary operations. For a
testcase like this:

int %test(int* %P, int %A) {
        %Pv = load int* %P
        %B = add int %A, %Pv
        ret int %B
}

We now generate:
test:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        add %EAX, DWORD PTR [%ECX]
        ret

Instead of:
test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%EAX]
        add %EAX, %ECX
        ret

... saving one instruction, and often a register.  Note that there are a lot
of other instructions that could use this, but they aren't handled.  I'm not
really interested in adding them, but mul/div and all of the FP instructions
could be supported as well if someone wanted to add them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12204 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 01:58:35 +00:00
Chris Lattner
721d2d4a6e Rearrange and refactor some code. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 01:18:36 +00:00
Chris Lattner
9440db8866 Implement ArgumentPromotion/aggregate-promote.ll
This allows pointers to aggregate objects, whose elements are only read, to
be promoted and passed in by element instead of by reference.  This can
enable a LOT of subsequent optimizations in the caller function.

It's worth pointing out that this stuff happens a LOT of C++ programs, because
objects in templates are generally passed around by reference.  When these
templates are instantiated on small aggregate or scalar types, however, it is
more efficient to pass them in by value than by reference.

This transformation triggers most on C++ codes (e.g. 334 times on eon), but
does happen on C codes as well.  For example, on mesa it triggers 72 times,
and on gcc it triggers 35 times.  this is amazingly good considering that
we are using 'basicaa' so far.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12202 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 01:04:36 +00:00
Chris Lattner
86a734bd40 Implement: ArgumentPromotion/chained.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 22:52:53 +00:00
Chris Lattner
7db5a6df78 Fix another minor bug, exposed by perlbmk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12198 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 22:43:27 +00:00
Chris Lattner
c76d80342e Since 'load null' is undefined, we can make it do whatever we want. Returning
a zero value is the most likely way to cause further simplification, so we do it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12197 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 22:16:24 +00:00
Chris Lattner
7e6f5090af Fix a minor bug and turn debug output into, well, debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12195 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 21:54:50 +00:00
Chris Lattner
ed570a7dca New LLVM pass: argument promotion. This version only handles simple scalar
variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12193 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 21:29:54 +00:00
Alkis Evlogimenos
13d362f310 Add memory operand version of conditional move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-07 03:19:11 +00:00
Alkis Evlogimenos
5ae00066c6 As I wrote in the docs, simple is the default spiller :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12189 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 23:08:44 +00:00
Alkis Evlogimenos
499b2bad27 Add simple spiller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12188 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 22:38:29 +00:00
Brian Gaeke
08f64c3321 Support return values of basic integer types.
Emit RETL instruction to return instead of funny JMPL.
Fix indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12186 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 05:32:28 +00:00
Brian Gaeke
a8056fabeb Sort stanzas into Sparc V8 book page number order.
Add RET, RETL.  Rename SAVE, RESTORE & JMPL for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12185 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 05:32:13 +00:00
Brian Gaeke
bda4a3c61a Hack it so we do not try to allocate values to G0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12184 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 05:31:32 +00:00
Brian Gaeke
d69b3c58d3 Make prolog align stack properly. Make epilog not touch any registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12183 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 05:31:21 +00:00
Brian Gaeke
a8b00cafc4 Emit register names in lowercase, as required by the assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12182 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 05:30:21 +00:00
Brian Gaeke
a98e051417 Teach getRegClassForType where to find FP registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12180 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-06 03:54:13 +00:00
Chris Lattner
deb8712b49 Fix a minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12169 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-05 22:04:07 +00:00
Misha Brukman
a5f2905c71 Unbreak the build on Sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-05 20:04:40 +00:00
Brian Gaeke
62aa28aef3 Asm output is looking a lot better; not correct for all operands yet though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12143 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-05 08:39:09 +00:00
Chris Lattner
4ab483c6ad Fix a bug in a previous checkin that broke 175.vpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12128 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 21:36:57 +00:00
Chris Lattner
3aeb40cadb Add support for strto* and v*printf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12127 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 21:03:54 +00:00
Chris Lattner
6b3e3ccf73 Add non-crappy support for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12126 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 20:33:47 +00:00
Chris Lattner
e6e93ccd0c Implement a FIXME, improving the efficiency of DSA on povray.
This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes
from 129420 to 116477.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12125 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:47:04 +00:00
Brian Gaeke
7a3ae1fbad Support -print-machineinstrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12124 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:22:16 +00:00
Chris Lattner
da5c5a5b95 Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:16:35 +00:00
Brian Gaeke
323819e4e1 make -print-machineinstrs work for both SparcV9 and X86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 19:16:23 +00:00
Alkis Evlogimenos
ce1e500e2f Add assertion for scale verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12120 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 18:05:02 +00:00
Alkis Evlogimenos
5f65adda50 Hide variable from other functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 17:50:44 +00:00
Chris Lattner
f590ced5c5 Fix BU datastructures with povray!
The problem was that we were merging a field of a node with a value that was
deleted.  Thanks to bugpoint for reducing povray to a nice small 3 function
example.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12116 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 17:06:53 +00:00
Chris Lattner
16437ff705 Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12115 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 17:05:28 +00:00
Brian Gaeke
4acfd039f9 Asm printer support, based on x86 - only prints mnemonics for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 06:00:41 +00:00
Brian Gaeke
da69e7d9b3 Double-FP pseudo-registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12112 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 05:15:03 +00:00
Brian Gaeke
775158d62a Subtract instructions; minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-04 04:37:45 +00:00