Commit Graph

68888 Commits

Author SHA1 Message Date
Cameron Zwarich
19feb4ca8a Tidy up indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 10:10:02 +00:00
Cameron Zwarich
a4d93162cb Fix a typo, which should also fix the failure on llvm-x86_64-linux-checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 10:06:44 +00:00
Chris Lattner
cf078f2b20 Allow loop-idiom to run on multiple BB loops, but still only scan the loop
header for now for memset/memcpy opportunities.  It turns out that loop-rotate
is successfully rotating loops, but *DOESN'T MERGE THE BLOCKS*, turning "for 
loops" into 2 basic block loops that loop-idiom was ignoring.

With this fix, we form many *many* more memcpy and memsets than before, including
on the "history" loops in the viterbi benchmark, which look like this:

        for (j=0; j<MAX_history; ++j) {
          history_new[i][j+1] = history[2*i][j];
        }

Transforming these loops into memcpy's speeds up the viterbi benchmark from
11.98s to 3.55s on my machine.  Woo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:58:36 +00:00
Cameron Zwarich
c9e152b778 Remove the #ifdef'd code for balancing the eval-link data structure. It doesn't
compile, and everyone's tests have shown it to be slower in practice, even for
quite large graphs.

I also hope to do an optimization that is only correct with the simpler data
structure, which would break this even further.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:53:49 +00:00
Chris Lattner
6b04160dd8 remove debugging code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:37:13 +00:00
Chris Lattner
4ce31fb574 add some -stats output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:36:44 +00:00
Chris Lattner
d9e079706e improve loop rotation to use CodeMetrics to analyze the
size of a loop header instead of its own code size estimator.
This allows it to handle bitcasts etc more precisely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122681 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:35:53 +00:00
Cameron Zwarich
8252ad1351 Speed up dominator computation some more by optimizing bucket processing. When
naively implemented, the Lengauer-Tarjan algorithm requires a separate bucket
for each vertex. However, this is unnecessary, because each vertex is only
placed into a single bucket (that of its semidominator), and each vertex's
bucket is processed before it is added to any bucket itself.

Instead of using a bucket per vertex, we use a single array Buckets that has two
purposes. Before the vertex V with DFS number i is processed, Buckets[i] stores
the index of the first element in V's bucket. After V's bucket is processed,
Buckets[i] stores the index of the next element in the bucket to which V now
belongs, if any.

Reading from the buckets can also be optimized. Instead of processing the bucket
of V's parent at the end of processing V, we process the bucket of V itself at
the beginning of processing V. This means that the case of the root vertex can
be simplified somewhat. It also means that we don't need to look up the DFS
number of the semidominator of every node in the bucket we are processing,
since we know it is the current index being processed.

This is a 6.5% speedup running -domtree on test-suite + SPEC2000/2006, with
larger speedups of around 12% on the larger benchmarks like GCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 07:03:00 +00:00
Chris Lattner
e2c4392091 teach loop idiom recognition to form memcpy's from simple loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122678 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 03:37:56 +00:00
Nick Lewycky
abd6c75409 Remove functions from the FnSet when one of their callee's is being merged. This
maintains the guarantee that the DenseSet expects two elements it contains to
not go from inequal to equal under its nose.

As a side-effect, this also lets us switch from iterating to a fixed-point to
actually maintaining a work queue of functions to look at again, and we don't
add thunks to our work queue so we don't need to detect and ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122677 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 02:46:33 +00:00
Chris Lattner
15df04472a a missed __builtin_object_size case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 22:57:31 +00:00
Chris Lattner
9c8fb9e820 various updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 22:52:11 +00:00
Chris Lattner
d91ed10b70 fix a globalopt crash on two Adobe-C++ testcases that the recent
loop idiom pass exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122674 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 22:31:46 +00:00
Rafael Espindola
1acf707cce Fix darwin bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:58:41 +00:00
Benjamin Kramer
5bfd628556 Remove empty directories left behind by git-svn users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:53:18 +00:00
Rafael Espindola
03277e7fb4 Add support for the 'H' modifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:58:46 +00:00
Anton Korobeynikov
1db58f936b Update the test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:57:26 +00:00
Chris Lattner
0fd8ee4995 turn on memset idiom recognition by default. Though there are still lots of
limitations, this kicks in dozens of times in the 4 specfp2000 benchmarks, 
and hundreds of times in the int part.  It also kicks in hundreds of times 
in multisource.

This kicks in right before loop deletion, which has the pleasant effect of
deleting loops that *just* do a memset.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:39:18 +00:00
Anton Korobeynikov
4d72860835 Model operand restrictions of mul-like instructions on ARMv5 via
earlyclobber stuff. This should fix PRs 2313 and 8157.

Unfortunately, no testcase, since it'd be dependent on register
assignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122663 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:38:38 +00:00
Chris Lattner
bafa117e8f add a validity check that was missed, fixing a crash on the
new testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:12:04 +00:00
Duncan Sands
124708d9b4 Revert commit 122654 at the request of Chris, who reckons that instsimplify
is the wrong hammer for this nail, and is probably right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:08:02 +00:00
Chris Lattner
a64cbf067d improve validity check to handle constant-trip-count loops more
aggressively.  In practice, this doesn't help anything though,
see the todo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122660 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 19:54:22 +00:00
Chris Lattner
30980b6815 implement the "no aliasing accesses in loop" safety check. This pass
should be correct now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 19:39:01 +00:00
Rafael Espindola
7a54997d67 Fix PR8878.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 19:05:35 +00:00
Duncan Sands
5e09eefe95 Correct a bunch of mistakes which meant that the example pass didn't
even compile, let alone work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 17:37:07 +00:00
Duncan Sands
dc97c0b2c7 I was unable to get the instructions to work if LLVM was built
using a separate objects directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122656 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 17:28:49 +00:00
Duncan Sands
779ff7fd82 Clarify that the loadable module turns up in the top-level directory,
not locally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 17:21:58 +00:00
Duncan Sands
7cf85e74e3 Fix a README item by having InstructionSimplify do a mild form of value
numbering, in which it considers (for example) "%a = add i32 %x, %y" and
"%b = add i32 %x, %y" to be equal because the operands are equal and the
result of the instructions only depends on the values of the operands.
This has almost no effect (it removes 4 instructions from gcc-as-one-file),
and perhaps slows down compilation: I measured a 0.4% slowdown on the large
gcc-as-one-file testcase, but it wasn't statistically significant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122654 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 16:12:09 +00:00
Che-Liang Chiou
c88e91b875 ptx: remove reg-reg addressing mode and st.const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122653 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 11:58:58 +00:00
Che-Liang Chiou
ad83c1d383 ptx: add store instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 10:50:37 +00:00
Erick Tryzelaar
7a31865b1a Add a reference to the OCamlLangImpl8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122651 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 03:29:25 +00:00
Erick Tryzelaar
160dae7d7f Add an OCaml tutorial page 8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 03:27:43 +00:00
Oscar Fuentes
ba6f918a6d Add to the list of cmake files the object file, not the asm file. This
is necessary for executing the custom command that runs the
assember. Fixes PR8877.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 20:15:37 +00:00
Oscar Fuentes
023c63351e CMake (MSVC): cmake automatically adds the /EHsc and /GR compiler
options. If we are building with exceptions/rtti disabled, we replace
/EHsc with /EHs-c- and /GR with /GR-, respectively. If we just add the
disabling options we get warnings like this:

cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 19:10:49 +00:00
Duncan Sands
8a3d29cf10 Simplify this pass by using a depth-first iterator to ensure that all
operands are visited before the instructions themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 17:49:05 +00:00
Duncan Sands
fea0b8b666 Zap dead instructions harder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 16:17:54 +00:00
Benjamin Kramer
1928236514 Make a bunch of symbols internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 22:34:44 +00:00
Nick Lewycky
c00210cef2 Add another non-commutable instruction that gas accepts commuted forms for.
Fixes PR8861.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 22:10:49 +00:00
Che-Liang Chiou
d34f19f7ba ptx: add state spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 10:41:27 +00:00
Chris Lattner
a797ee0210 include the module identifier when emitting this warning, PR8865.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 02:49:45 +00:00
Chris Lattner
c7bad77606 print the right string, thanks for Frits for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 01:07:20 +00:00
Cameron Zwarich
d16ad3e43c Use getVRegDef() instead of def_iterator. This leads to fewer defs being added
with 2-address instructions, for about a 3.5% speedup of StrongPHIElimination on
403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 00:42:23 +00:00
Chris Lattner
e0f6db369d improve warning message to at least say what the triples are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 22:41:18 +00:00
Wesley Peck
b4aec92453 Fix stack layout error in MBlaze backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 19:46:28 +00:00
Daniel Dunbar
b2624eda5a MC/Mach-O/Thumb: Set the thumb bit in the symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 14:14:06 +00:00
Cameron Zwarich
dd061b3177 None of the other pass names in CodeGen have terminating periods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 11:49:10 +00:00
Cameron Zwarich
1558f5ed19 Instead of processing every instruction when splitting interferences, only
process those instructions that define phi sources. This is a 47% speedup of
StrongPHIElimination compile time on 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 11:00:09 +00:00
Venkatraman Govindaraju
12db7b68b6 SPARC backend fix: correctly passing arguments through stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 05:37:15 +00:00
Cameron Zwarich
7fb95d4235 Add a missing word to a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 04:42:39 +00:00
Rafael Espindola
caf1158b0f Correctly encode pcrel|indirect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 04:31:26 +00:00