oota-llvm.git
13 years agovarious cleanups, no functionality change.
Chris Lattner [Mon, 3 Jan 2011 03:28:23 +0000 (03:28 +0000)]
various cleanups, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122729 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd spliceFunction to the CallGraph interface. This allows users to efficiently
Nick Lewycky [Mon, 3 Jan 2011 03:19:35 +0000 (03:19 +0000)]
Add spliceFunction to the CallGraph interface. This allows users to efficiently
update a callGraph when performing the common operation of splicing the body to
a new function and updating all callers (such as via RAUW).

No users yet, though this is intended for DeadArgumentElimination as part of
PR8887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122728 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach EarlyCSE to do trivial CSE of loads and read-only calls.
Chris Lattner [Mon, 3 Jan 2011 03:18:43 +0000 (03:18 +0000)]
Teach EarlyCSE to do trivial CSE of loads and read-only calls.

On 176.gcc, this catches 13090 loads and calls, and increases the
number of simple instructions CSE'd from 29658 to 36208.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122727 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a handy typedef.
Chris Lattner [Mon, 3 Jan 2011 03:16:20 +0000 (03:16 +0000)]
add a handy typedef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122726 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorename InstValue to SimpleValue, add some comments.
Chris Lattner [Mon, 3 Jan 2011 02:20:48 +0000 (02:20 +0000)]
rename InstValue to SimpleValue, add some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122725 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: Add missing source file.
Michael J. Spencer [Mon, 3 Jan 2011 02:13:05 +0000 (02:13 +0000)]
CMake: Add missing source file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122724 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAllocate nodes for the scoped hash table from a recyling bump pointer
Chris Lattner [Mon, 3 Jan 2011 01:42:46 +0000 (01:42 +0000)]
Allocate nodes for the scoped hash table from a recyling bump pointer
allocator.  This speeds up early cse by about 20%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122723 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoreally get this working with a custom allocator.
Chris Lattner [Mon, 3 Jan 2011 01:38:29 +0000 (01:38 +0000)]
really get this working with a custom allocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122722 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance ScopedHashTable to allow it to take an allocator argument.
Chris Lattner [Mon, 3 Jan 2011 01:29:37 +0000 (01:29 +0000)]
Enhance ScopedHashTable to allow it to take an allocator argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122721 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoreduce redundancy in the hashing code and other misc cleanups.
Chris Lattner [Mon, 3 Jan 2011 01:10:08 +0000 (01:10 +0000)]
reduce redundancy in the hashing code and other misc cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122720 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a new loop-instsimplify pass, with the intention of replacing the instance
Cameron Zwarich [Mon, 3 Jan 2011 00:25:16 +0000 (00:25 +0000)]
Add a new loop-instsimplify pass, with the intention of replacing the instance
of instcombine that is currently in the middle of the loop pass pipeline. This
commit only checks in the pass; it will hopefully be enabled by default later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122719 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix some pastos
Chris Lattner [Sun, 2 Jan 2011 23:29:58 +0000 (23:29 +0000)]
fix some pastos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122718 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd DEBUG and -stats output to earlycse.
Chris Lattner [Sun, 2 Jan 2011 23:19:45 +0000 (23:19 +0000)]
add DEBUG and -stats output to earlycse.
Teach it to CSE the rest of the non-side-effecting instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122716 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance earlycse to do CSE of casts, instsimplify and die.
Chris Lattner [Sun, 2 Jan 2011 23:04:14 +0000 (23:04 +0000)]
Enhance earlycse to do CSE of casts, instsimplify and die.
Add a testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122715 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agosplit dom frontier handling stuff out to its own DominanceFrontier header,
Chris Lattner [Sun, 2 Jan 2011 22:09:33 +0000 (22:09 +0000)]
split dom frontier handling stuff out to its own DominanceFrontier header,
so that Dominators.h is *just* domtree.  Also prune #includes a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122714 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agosketch out a new early cse pass. No functionality yet.
Chris Lattner [Sun, 2 Jan 2011 21:47:05 +0000 (21:47 +0000)]
sketch out a new early cse pass.  No functionality yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122713 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix a miscompilation of tramp3d-v4: when forming a memcpy, we have to make
Chris Lattner [Sun, 2 Jan 2011 21:14:18 +0000 (21:14 +0000)]
fix a miscompilation of tramp3d-v4: when forming a memcpy, we have to make
sure that the loop we're promoting into a memcpy doesn't mutate the input
of the memcpy.  Before we were just checking that the dest of the memcpy
wasn't mod/ref'd by the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122712 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIf a loop iterates exactly once (has backedge count = 0) then don't
Chris Lattner [Sun, 2 Jan 2011 20:24:21 +0000 (20:24 +0000)]
If a loop iterates exactly once (has backedge count = 0) then don't
mess with it.  We'd rather peel/unroll it than convert all of its
stores into memsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122711 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry to reuse the value when lowering memset.
Benjamin Kramer [Sun, 2 Jan 2011 19:57:05 +0000 (19:57 +0000)]
Try to reuse the value when lowering memset.

This allows us to compile:
  void test(char *s, int a) {
    __builtin_memset(s, a, 15);
  }
into 1 mul + 3 stores instead of 3 muls + 3 stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122710 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLower the i8 extension in memset to a multiply instead of a potentially long series...
Benjamin Kramer [Sun, 2 Jan 2011 19:44:58 +0000 (19:44 +0000)]
Lower the i8 extension in memset to a multiply instead of a potentially long series of shifts and ors.

We could implement a DAGCombine to turn x * 0x0101 back into logic operations
on targets that doesn't support the multiply or it is slow (p4) if someone cares
enough.

Example code:
  void test(char *s, int a) {
      __builtin_memset(s, a, 4);
  }
before:
  _test:                                  ## @test
    movzbl  8(%esp), %eax
    movl  %eax, %ecx
    shll  $8, %ecx
    orl %eax, %ecx
    movl  %ecx, %eax
    shll  $16, %eax
    orl %ecx, %eax
    movl  4(%esp), %ecx
    movl  %eax, 4(%ecx)
    movl  %eax, (%ecx)
    ret
after:
  _test:                                  ## @test
    movzbl  8(%esp), %eax
    imull $16843009, %eax, %eax   ## imm = 0x1010101
    movl  4(%esp), %ecx
    movl  %eax, 4(%ecx)
    movl  %eax, (%ecx)
    ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122707 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA workaround for a bug in cmake 2.8.3 diagnosed on PR 8885.
Oscar Fuentes [Sun, 2 Jan 2011 19:32:31 +0000 (19:32 +0000)]
A workaround for a bug in cmake 2.8.3 diagnosed on PR 8885.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122706 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAlso remove functions that use complex constant expressions in terms of
Nick Lewycky [Sun, 2 Jan 2011 19:16:44 +0000 (19:16 +0000)]
Also remove functions that use complex constant expressions in terms of
another function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122705 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoenhance loop idiom recognition to scan *all* unconditionally executed
Chris Lattner [Sun, 2 Jan 2011 19:01:03 +0000 (19:01 +0000)]
enhance loop idiom recognition to scan *all* unconditionally executed
blocks in a loop, instead of just the header block.  This makes it more
aggressive, able to handle Duncan's Ada examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122704 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomake inSubLoop much more efficient.
Chris Lattner [Sun, 2 Jan 2011 18:53:08 +0000 (18:53 +0000)]
make inSubLoop much more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122703 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorip out isExitBlockDominatedByBlockInLoop, calling DomTree::dominates instead.
Chris Lattner [Sun, 2 Jan 2011 18:45:39 +0000 (18:45 +0000)]
rip out isExitBlockDominatedByBlockInLoop, calling DomTree::dominates instead.

isExitBlockDominatedByBlockInLoop is a relic of the days when domtree was
*just* a tree and didn't have DFS numbers.  Checking DFS numbers is faster
and easier than "limiting the search of the tree".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122702 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a list of opportunities for future improvement.
Chris Lattner [Sun, 2 Jan 2011 18:32:09 +0000 (18:32 +0000)]
add a list of opportunities for future improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122701 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoupdate a bunch of entries.
Chris Lattner [Sun, 2 Jan 2011 18:31:38 +0000 (18:31 +0000)]
update a bunch of entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122700 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix PR8702 by not having LoopSimplify claim to preserve LCSSA form. As described
Duncan Sands [Sun, 2 Jan 2011 13:38:21 +0000 (13:38 +0000)]
Fix PR8702 by not having LoopSimplify claim to preserve LCSSA form.  As described
in the PR, the pass could break LCSSA form when inserting preheaders.  It probably
would be easy enough to fix this, but since currently we always go into LCSSA form
after running this pass, doing so is not urgent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122695 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove an unused member function.
Cameron Zwarich [Sun, 2 Jan 2011 12:37:22 +0000 (12:37 +0000)]
Remove an unused member function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122693 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPropagate to parent scope changes made to CMAKE_CXX_FLAGS.
Oscar Fuentes [Sun, 2 Jan 2011 12:30:18 +0000 (12:30 +0000)]
Propagate to parent scope changes made to CMAKE_CXX_FLAGS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122692 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a typo in a variable name.
Cameron Zwarich [Sun, 2 Jan 2011 12:17:10 +0000 (12:17 +0000)]
Fix a typo in a variable name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122691 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove a load into the only branch where it is used and eliminate a temporary.
Cameron Zwarich [Sun, 2 Jan 2011 10:50:14 +0000 (10:50 +0000)]
Move a load into the only branch where it is used and eliminate a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122690 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd the explanatory comment from r122680's commit message to the code itself.
Cameron Zwarich [Sun, 2 Jan 2011 10:40:14 +0000 (10:40 +0000)]
Add the explanatory comment from r122680's commit message to the code itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122689 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up indentation.
Cameron Zwarich [Sun, 2 Jan 2011 10:10:02 +0000 (10:10 +0000)]
Tidy up indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122688 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a typo, which should also fix the failure on llvm-x86_64-linux-checks.
Cameron Zwarich [Sun, 2 Jan 2011 10:06:44 +0000 (10:06 +0000)]
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

13 years agoAllow loop-idiom to run on multiple BB loops, but still only scan the loop
Chris Lattner [Sun, 2 Jan 2011 07:58:36 +0000 (07:58 +0000)]
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

13 years agoRemove the #ifdef'd code for balancing the eval-link data structure. It doesn't
Cameron Zwarich [Sun, 2 Jan 2011 07:53:49 +0000 (07:53 +0000)]
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

13 years agoremove debugging code.
Chris Lattner [Sun, 2 Jan 2011 07:37:13 +0000 (07:37 +0000)]
remove debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122683 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd some -stats output.
Chris Lattner [Sun, 2 Jan 2011 07:36:44 +0000 (07:36 +0000)]
add some -stats output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122682 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoimprove loop rotation to use CodeMetrics to analyze the
Chris Lattner [Sun, 2 Jan 2011 07:35:53 +0000 (07:35 +0000)]
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

13 years agoSpeed up dominator computation some more by optimizing bucket processing. When
Cameron Zwarich [Sun, 2 Jan 2011 07:03:00 +0000 (07:03 +0000)]
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

13 years agoteach loop idiom recognition to form memcpy's from simple loops.
Chris Lattner [Sun, 2 Jan 2011 03:37:56 +0000 (03:37 +0000)]
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

13 years agoRemove functions from the FnSet when one of their callee's is being merged. This
Nick Lewycky [Sun, 2 Jan 2011 02:46:33 +0000 (02:46 +0000)]
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

13 years agoa missed __builtin_object_size case.
Chris Lattner [Sat, 1 Jan 2011 22:57:31 +0000 (22:57 +0000)]
a missed __builtin_object_size case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122676 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agovarious updates.
Chris Lattner [Sat, 1 Jan 2011 22:52:11 +0000 (22:52 +0000)]
various updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122675 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix a globalopt crash on two Adobe-C++ testcases that the recent
Chris Lattner [Sat, 1 Jan 2011 22:31:46 +0000 (22:31 +0000)]
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

13 years agoFix darwin bots.
Rafael Espindola [Sat, 1 Jan 2011 21:58:41 +0000 (21:58 +0000)]
Fix darwin bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122672 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove empty directories left behind by git-svn users.
Benjamin Kramer [Sat, 1 Jan 2011 21:53:18 +0000 (21:53 +0000)]
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

13 years agoAdd support for the 'H' modifier.
Rafael Espindola [Sat, 1 Jan 2011 20:58:46 +0000 (20:58 +0000)]
Add support for the 'H' modifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122667 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate the test
Anton Korobeynikov [Sat, 1 Jan 2011 20:57:26 +0000 (20:57 +0000)]
Update the test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122666 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoturn on memset idiom recognition by default. Though there are still lots of
Chris Lattner [Sat, 1 Jan 2011 20:39:18 +0000 (20:39 +0000)]
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

13 years agoModel operand restrictions of mul-like instructions on ARMv5 via
Anton Korobeynikov [Sat, 1 Jan 2011 20:38:38 +0000 (20:38 +0000)]
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

13 years agoadd a validity check that was missed, fixing a crash on the
Chris Lattner [Sat, 1 Jan 2011 20:12:04 +0000 (20:12 +0000)]
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

13 years agoRevert commit 122654 at the request of Chris, who reckons that instsimplify
Duncan Sands [Sat, 1 Jan 2011 20:08:02 +0000 (20:08 +0000)]
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

13 years agoimprove validity check to handle constant-trip-count loops more
Chris Lattner [Sat, 1 Jan 2011 19:54:22 +0000 (19:54 +0000)]
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

13 years agoimplement the "no aliasing accesses in loop" safety check. This pass
Chris Lattner [Sat, 1 Jan 2011 19:39:01 +0000 (19:39 +0000)]
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

13 years agoFix PR8878.
Rafael Espindola [Sat, 1 Jan 2011 19:05:35 +0000 (19:05 +0000)]
Fix PR8878.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122658 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrect a bunch of mistakes which meant that the example pass didn't
Duncan Sands [Sat, 1 Jan 2011 17:37:07 +0000 (17:37 +0000)]
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

13 years agoI was unable to get the instructions to work if LLVM was built
Duncan Sands [Sat, 1 Jan 2011 17:28:49 +0000 (17:28 +0000)]
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

13 years agoClarify that the loadable module turns up in the top-level directory,
Duncan Sands [Sat, 1 Jan 2011 17:21:58 +0000 (17:21 +0000)]
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

13 years agoFix a README item by having InstructionSimplify do a mild form of value
Duncan Sands [Sat, 1 Jan 2011 16:12:09 +0000 (16:12 +0000)]
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

13 years agoptx: remove reg-reg addressing mode and st.const
Che-Liang Chiou [Sat, 1 Jan 2011 11:58:58 +0000 (11:58 +0000)]
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

13 years agoptx: add store instruction
Che-Liang Chiou [Sat, 1 Jan 2011 10:50:37 +0000 (10:50 +0000)]
ptx: add store instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122652 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a reference to the OCamlLangImpl8.
Erick Tryzelaar [Sat, 1 Jan 2011 03:29:25 +0000 (03:29 +0000)]
Add a reference to the OCamlLangImpl8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122651 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd an OCaml tutorial page 8
Erick Tryzelaar [Sat, 1 Jan 2011 03:27:43 +0000 (03:27 +0000)]
Add an OCaml tutorial page 8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122650 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd to the list of cmake files the object file, not the asm file. This
Oscar Fuentes [Fri, 31 Dec 2010 20:15:37 +0000 (20:15 +0000)]
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

13 years agoCMake (MSVC): cmake automatically adds the /EHsc and /GR compiler
Oscar Fuentes [Fri, 31 Dec 2010 19:10:49 +0000 (19:10 +0000)]
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

13 years agoSimplify this pass by using a depth-first iterator to ensure that all
Duncan Sands [Fri, 31 Dec 2010 17:49:05 +0000 (17:49 +0000)]
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

13 years agoZap dead instructions harder.
Duncan Sands [Fri, 31 Dec 2010 16:17:54 +0000 (16:17 +0000)]
Zap dead instructions harder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122645 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake a bunch of symbols internal.
Benjamin Kramer [Thu, 30 Dec 2010 22:34:44 +0000 (22:34 +0000)]
Make a bunch of symbols internal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122642 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd another non-commutable instruction that gas accepts commuted forms for.
Nick Lewycky [Thu, 30 Dec 2010 22:10:49 +0000 (22:10 +0000)]
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

13 years agoptx: add state spaces
Che-Liang Chiou [Thu, 30 Dec 2010 10:41:27 +0000 (10:41 +0000)]
ptx: add state spaces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122638 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoinclude the module identifier when emitting this warning, PR8865.
Chris Lattner [Thu, 30 Dec 2010 02:49:45 +0000 (02:49 +0000)]
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

13 years agoprint the right string, thanks for Frits for noticing.
Chris Lattner [Thu, 30 Dec 2010 01:07:20 +0000 (01:07 +0000)]
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

13 years agoUse getVRegDef() instead of def_iterator. This leads to fewer defs being added
Cameron Zwarich [Thu, 30 Dec 2010 00:42:23 +0000 (00:42 +0000)]
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

13 years agoimprove warning message to at least say what the triples are.
Chris Lattner [Wed, 29 Dec 2010 22:41:18 +0000 (22:41 +0000)]
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

13 years agoFix stack layout error in MBlaze backend.
Wesley Peck [Wed, 29 Dec 2010 19:46:28 +0000 (19:46 +0000)]
Fix stack layout error in MBlaze backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122631 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMC/Mach-O/Thumb: Set the thumb bit in the symbol table.
Daniel Dunbar [Wed, 29 Dec 2010 14:14:06 +0000 (14:14 +0000)]
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

13 years agoNone of the other pass names in CodeGen have terminating periods.
Cameron Zwarich [Wed, 29 Dec 2010 11:49:10 +0000 (11:49 +0000)]
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

13 years agoInstead of processing every instruction when splitting interferences, only
Cameron Zwarich [Wed, 29 Dec 2010 11:00:09 +0000 (11:00 +0000)]
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

13 years agoSPARC backend fix: correctly passing arguments through stack
Venkatraman Govindaraju [Wed, 29 Dec 2010 05:37:15 +0000 (05:37 +0000)]
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

13 years agoAdd a missing word to a comment.
Cameron Zwarich [Wed, 29 Dec 2010 04:42:39 +0000 (04:42 +0000)]
Add a missing word to a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122625 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrectly encode pcrel|indirect.
Rafael Espindola [Wed, 29 Dec 2010 04:31:26 +0000 (04:31 +0000)]
Correctly encode pcrel|indirect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122624 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: Add disabling optimization on MSVC8 and MSVC10 as workaround for some files...
NAKAMURA Takumi [Wed, 29 Dec 2010 03:59:27 +0000 (03:59 +0000)]
CMake: Add disabling optimization on MSVC8 and MSVC10 as workaround for some files in Target/ARM and Target/X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122623 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoautoconf: Add --disable-embed-stdcxx to suppress linking libstdc++.a into llvm.dll...
NAKAMURA Takumi [Wed, 29 Dec 2010 03:59:14 +0000 (03:59 +0000)]
autoconf: Add --disable-embed-stdcxx to suppress linking libstdc++.a into llvm.dll with --enable-shared on Cygming.

Cygwin has stdc++.dll in it's distribution, and we can assume distro's stdc++.dll might be available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122622 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoautoconf: [PR7874] Add --disable-pthreads to suppress detecting pthreads on certain...
NAKAMURA Takumi [Wed, 29 Dec 2010 03:59:03 +0000 (03:59 +0000)]
autoconf: [PR7874] Add --disable-pthreads to suppress detecting pthreads on certain hosts.

This would be needed to build pthread*.dll-free distribution on recent MinGW-MSYS distros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122621 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/Transforms/ConstProp/logicaltest.ll: FileCheck-ize.
NAKAMURA Takumi [Wed, 29 Dec 2010 03:58:56 +0000 (03:58 +0000)]
test/Transforms/ConstProp/logicaltest.ll: FileCheck-ize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122620 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/X86/negative-sin.ll: FileCheck-ize.
NAKAMURA Takumi [Wed, 29 Dec 2010 03:58:47 +0000 (03:58 +0000)]
test/CodeGen/X86/negative-sin.ll: FileCheck-ize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122619 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/X86/fp-in-intregs.ll: FileCheck-ize.
NAKAMURA Takumi [Wed, 29 Dec 2010 03:58:36 +0000 (03:58 +0000)]
test/CodeGen/X86/fp-in-intregs.ll: FileCheck-ize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122618 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd text explaining an assertion.
Cameron Zwarich [Wed, 29 Dec 2010 03:52:51 +0000 (03:52 +0000)]
Add text explaining an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122617 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove second return.
Rafael Espindola [Wed, 29 Dec 2010 02:42:33 +0000 (02:42 +0000)]
Remove second return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122616 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix bug when trying to output uint16_t or uint32_t.
Rafael Espindola [Wed, 29 Dec 2010 02:30:49 +0000 (02:30 +0000)]
Fix bug when trying to output uint16_t or uint32_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122615 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement cfi_def_cfa. Also don't convert to dwarf reg numbers twice. Looks
Rafael Espindola [Wed, 29 Dec 2010 01:42:56 +0000 (01:42 +0000)]
Implement cfi_def_cfa. Also don't convert to dwarf reg numbers twice. Looks
like 6 is a fixed point of that and so the previous tests were OK :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122614 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
Chris Lattner [Wed, 29 Dec 2010 01:33:36 +0000 (01:33 +0000)]
fix PR8867: a crash handling fp128.  Thanks to Nick for the testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement cfi_def_cfa_register.
Rafael Espindola [Wed, 29 Dec 2010 00:26:06 +0000 (00:26 +0000)]
Implement cfi_def_cfa_register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122612 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoInitial .cfi_offset implementation.
Rafael Espindola [Wed, 29 Dec 2010 00:09:59 +0000 (00:09 +0000)]
Initial .cfi_offset implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122611 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify some code in MachineVerifier that was doing the correct thing, but not
Cameron Zwarich [Tue, 28 Dec 2010 23:45:38 +0000 (23:45 +0000)]
Simplify some code in MachineVerifier that was doing the correct thing, but not
in the most obvious way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122610 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't produce a "DW_CFA_advance_loc 0".
Rafael Espindola [Tue, 28 Dec 2010 23:38:03 +0000 (23:38 +0000)]
Don't produce a "DW_CFA_advance_loc 0".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122609 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert the optimization in r122596. It is correct for all current targets, but
Cameron Zwarich [Tue, 28 Dec 2010 23:02:56 +0000 (23:02 +0000)]
Revert the optimization in r122596. It is correct for all current targets, but
it relies on assumptions that may not be true in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122608 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMultiple SPARC backend fixes: added Y register; updated select_cc, subx, subxcc defs...
Venkatraman Govindaraju [Tue, 28 Dec 2010 20:39:17 +0000 (20:39 +0000)]
Multiple SPARC backend fixes: added Y register; updated select_cc, subx, subxcc defs/uses;
and fixed CustomInserter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122607 91177308-0d34-0410-b5e6-96231b3b80d8