1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

26169 Commits

Author SHA1 Message Date
Duncan Sands
ecb1273c5b Don't dereference the end() iterator. This was
causing a bunch of failures when running
"make ENABLE_EXPENSIVE_CHECKS=1 check".

llvm-svn: 60832
2008-12-10 09:38:36 +00:00
Mon P Wang
308879dcfc Fixed a bug when trying to optimize a extract vector element of a
bit convert that changes the number of elements of a shuffle.

llvm-svn: 60829
2008-12-10 03:59:02 +00:00
Evan Cheng
caa31a82fc Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids some overflow issues. Patch by Thomas Jablin.
llvm-svn: 60828
2008-12-10 02:32:19 +00:00
Bill Wendling
d33b6dfd4f Whitespace changes.
llvm-svn: 60826
2008-12-10 02:01:32 +00:00
Evan Cheng
1264f4bc9c Fix a bug introduced by r59265. If lazy compilation is disabled, return actual function ptr instead of ptr to stub if function is already compiled.
llvm-svn: 60822
2008-12-10 01:33:59 +00:00
Chris Lattner
3987712b2d move an entry, add some notes, remove a completed item (IMPLICIT_DEF)
llvm-svn: 60821
2008-12-10 01:30:48 +00:00
Chris Lattner
e2b5854e41 Allow basicaa to walk through geps with identical indices in
parallel, allowing it to decide that P/Q must alias if A/B
must alias in things like:
 P = gep A, 0, i, 1
 Q = gep B, 0, i, 1

This allows GVN to delete 62 more instructions out of 403.gcc.

llvm-svn: 60820
2008-12-10 01:04:47 +00:00
Bill Wendling
a3b718a3c9 Whitespace fixes.
llvm-svn: 60818
2008-12-10 00:28:22 +00:00
Dan Gohman
1967880025 Update CalcLatency to work in terms of edge latencies, rather than
node latencies. Use CalcLatency instead of manual code in
CalculatePriorities to keep it consistent. Previously it
computed slightly different results.

llvm-svn: 60817
2008-12-10 00:24:36 +00:00
Evan Cheng
9419dfe08a Fix a couple of Dwarf bugs.
- Emit DW_AT_byte_size for struct and union of size zero.
- Emit DW_AT_declaration for forward type declaration.

llvm-svn: 60812
2008-12-10 00:15:44 +00:00
Scott Michel
0b5c67e1e0 CellSPU:
- Fix bug 3185, with misc other cleanups.
- Needed to implement SPUInstrInfo::InsertBranch(). CAUTION: Not sure what
  gets or needs to get passed to InsertBranch() to insert a conditional
  branch. This will abort for now until a good test case shows up.

llvm-svn: 60811
2008-12-10 00:15:19 +00:00
Bill Wendling
1c1dacdd42 Implement fast-isel conversion of a branch instruction that's branching on an
overflow/carry from the "arithmetic with overflow" intrinsics. It searches the
machine basic block from bottom to top to find the SETO/SETC instruction that is
its conditional. If an instruction modifies EFLAGS before it reaches the
SETO/SETC instruction, then it defaults to the normal instruction emission.

llvm-svn: 60807
2008-12-09 23:19:12 +00:00
Dan Gohman
036cc300ad Rewrite the SDep class, and simplify some of the related code.
The Cost field is removed. It was only being used in a very limited way,
to indicate when the scheduler should attempt to protect a live register,
and it isn't really needed to do that. If we ever want the scheduler to
start inserting copies in non-prohibitive situations, we'll have to
rethink some things anyway.

A Latency field is added. Instead of giving each node a single
fixed latency, each edge can have its own latency. This will eventually
be used to model various micro-architecture properties more accurately.

The PointerIntPair class and an internal union are now used, which
reduce the overall size.

llvm-svn: 60806
2008-12-09 22:54:47 +00:00
Chris Lattner
2550938060 loosen up an assertion that isn't valid when called from
invalidateCachedPointerInfo.  Thanks to Bill for sending me
a testcase.

llvm-svn: 60805
2008-12-09 22:45:32 +00:00
Dan Gohman
a52e83a6ca Minor code simplification.
llvm-svn: 60804
2008-12-09 22:45:08 +00:00
Bill Wendling
4c8fb3a0cc Add sub/mul overflow intrinsics. This currently doesn't have a
target-independent way of determining overflow on multiplication. It's very
tricky. Patch by Zoltan Varga!

llvm-svn: 60800
2008-12-09 22:08:41 +00:00
Chris Lattner
23369496bc Teach GVN to invalidate some memdep information when it does an RAUW
of a pointer.  This allows is to catch more equivalencies.  For example,
the type_lists_compatible_p function used to require two iterations of
the gvn pass (!) to delete its 18 redundant loads because the first pass
would CSE all the addressing computation cruft, which would unblock the
second memdep/gvn passes from recognizing them.  This change allows
memdep/gvn to catch all 18 when run just once on the function (as is 
typical :) instead of just 3.

On all of 403.gcc, this bumps up the # reundandancies found from:

     63 gvn    - Number of instructions PRE'd
 153991 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted
to:
     63 gvn    - Number of instructions PRE'd
 154137 gvn    - Number of instructions deleted
  50185 gvn    - Number of loads deleted

+120 loads deleted isn't bad.

llvm-svn: 60799
2008-12-09 22:06:23 +00:00
Duncan Sands
88a2901801 Fix PR3117: not all nodes being legalized. The
essential problem was that the DAG can contain
random unused nodes which were never analyzed.
When remapping a value of a node being processed,
such a node may become used and need to be analyzed;
however due to operands being transformed during
analysis the node may morph into a different one.
Users of the morphing node need to be updated, and
this wasn't happening.  While there I added a bunch
of documentation and sanity checks, so I (or some
other poor soul) won't have to scratch their head
over this stuff so long trying to remember how it
was all supposed to work next time some obscure
problem pops up!  The extra sanity checking exposed
a few places where invariants weren't being preserved,
so those are fixed too.  Since some of the sanity
checking is expensive, I added a flag to turn it
on.  It is also turned on when building with
ENABLE_EXPENSIVE_CHECKS=1.

llvm-svn: 60797
2008-12-09 21:33:20 +00:00
Chris Lattner
6a5e9eaa36 Teach BasicAA::getModRefInfo(CallSite, CallSite) some
tricks based on readnone/readonly functions.

Teach memdep to look past readonly calls when analyzing
deps for a readonly call.  This allows elimination of a
few more calls from 403.gcc:

before:
     63 gvn    - Number of instructions PRE'd
 153986 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted

after:
     63 gvn    - Number of instructions PRE'd
 153991 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted

5 calls isn't much, but this adds plumbing for the next change.

llvm-svn: 60794
2008-12-09 21:19:42 +00:00
Chris Lattner
e0f69b32e5 Fix a fixme: allow memdep to see past read-only calls when doing
load dependence queries.  This allows GVN to eliminate a few more
instructions on 403.gcc:

 152598 gvn    - Number of instructions deleted
  49240 gvn    - Number of loads deleted
after:
 153986 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted

llvm-svn: 60786
2008-12-09 19:47:40 +00:00
Chris Lattner
0dbe02a270 rename getNonLocalDependency -> getNonLocalCallDependency, and remove
pointer stuff from it, simplifying the code a bit.

llvm-svn: 60783
2008-12-09 19:38:05 +00:00
Chris Lattner
3768aeb290 Switch GVN::processNonLocalLoad to using the new
MemDep::getNonLocalPointerDependency method.  There are
some open issues with this (missed optimizations) and
plenty of future work, but this does allow GVN to eliminate
*slightly* more loads (49246 vs 49033).

Switching over now allows simplification of the other code
path in memdep.

llvm-svn: 60780
2008-12-09 19:25:07 +00:00
Chris Lattner
b0aa96c25d random cleanups, no functionality change.
llvm-svn: 60779
2008-12-09 19:21:47 +00:00
Evan Cheng
b81948d88b Back out 60748 for now. It's breaking SPASS, 254.gap, and 464.h264ref.
llvm-svn: 60776
2008-12-09 18:21:49 +00:00
Evan Cheng
92299e0722 Cosmetic changes.
llvm-svn: 60771
2008-12-09 17:56:30 +00:00
Nuno Lopes
360aae23b1 remove unused var
llvm-svn: 60770
2008-12-09 17:04:06 +00:00
Dan Gohman
275e6da839 Whitespace cleanups.
llvm-svn: 60769
2008-12-09 16:37:48 +00:00
Duncan Sands
392ed50974 Handle a compiler warning.
llvm-svn: 60755
2008-12-09 09:58:11 +00:00
Chris Lattner
ff8be5564e fix typos gabor noticed
llvm-svn: 60754
2008-12-09 08:38:36 +00:00
Bill Wendling
d034543c7e Correct my English.
llvm-svn: 60753
2008-12-09 07:55:31 +00:00
Chris Lattner
b7b4a2dbac restructure the top level non-local ptr dep query to handle
the first block of a query specially.  This makes the "complete query
caching" subsystem more effective, avoiding predecessor queries.  This
speeds up GVN another 4%.

llvm-svn: 60752
2008-12-09 07:52:59 +00:00
Chris Lattner
f61cc24ef3 rename getNonLocalPointerDepInternal -> getNonLocalPointerDepFromBB
and split its inner loop out into a new GetNonLocalInfoForBlock
function.  No functionality change.

llvm-svn: 60751
2008-12-09 07:47:11 +00:00
Evan Cheng
3130873f30 DisableGVCompilation should not abort on internal GlobalValue's.
llvm-svn: 60750
2008-12-09 07:31:49 +00:00
Mon P Wang
85d72dabc5 In LegalizeOp, don't change the result type of CONVERT_RNDSAT when promoting
one of its operand.

llvm-svn: 60749
2008-12-09 07:27:39 +00:00
Nick Lewycky
41060b1556 It's easy to handle SLE/SGE when the loop has a unit stride.
llvm-svn: 60748
2008-12-09 07:25:04 +00:00
Chris Lattner
7358482dbc if we have two elements, insert both, don't use std::sort.
This speeds up the new GVN by another 3%

llvm-svn: 60747
2008-12-09 07:05:45 +00:00
Chris Lattner
e428927eda If we're only adding one new element to 'Cache', insert it into its known
position instead of using a full sort. This speeds up GVN by ~4% with the
new memdep stuff.

llvm-svn: 60746
2008-12-09 06:58:04 +00:00
Chris Lattner
951d1310c9 convert a couple other places that use pred_iterator to use the caching
pred iterator.

llvm-svn: 60745
2008-12-09 06:44:17 +00:00
Chris Lattner
d7df2dce20 use hte new pred cache to speed up the new non-local memdep
queries.  This speeds up GVN using the new queries (not yet
checked in) by just over 10%.

llvm-svn: 60743
2008-12-09 06:28:49 +00:00
Mon P Wang
0c011f8ba9 Fix getNode to allow a vector for the shift amount for shifts of vectors.
Fix the shift amount when unrolling a vector shift into scalar shifts.
Fix problem in getShuffleScalarElt where it assumes that the input of
a bit convert must be a vector.

llvm-svn: 60740
2008-12-09 05:46:39 +00:00
Chris Lattner
e32dbaddd2 Fix a really subtle off-by-one bug that Duncan noticed with valgrind
on test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.

llvm-svn: 60739
2008-12-09 04:47:21 +00:00
Scott Michel
cf7ec43939 CellSPU:
- Change default scheduling preference to list-burr, which produces somewhat
  better code than the default. Could also use list-tdrr, but need to ask
  dev list about the appropriate handy mnemonic before commiting.

llvm-svn: 60738
2008-12-09 03:37:19 +00:00
Bill Wendling
7250a29def Add initial support for fast-isel of the [SU]ADDO intrinsics. It isn't
complete. For instance, it lowers the common case into this less-than-optimal
code:

        addl    %ecx, %eax
        seto    %cl
        testb   %cl, %cl
        jne     LBB1_2  ## overflow

instead of:

        addl    %ecx, %eax
        jo      LBB1_2  ## overflow

That will come in a future commit.

llvm-svn: 60737
2008-12-09 02:42:50 +00:00
Dan Gohman
e99b76aa24 Don't charge full latency for an anti-dependence, in this simplistic
pipeline model.

llvm-svn: 60733
2008-12-09 00:26:46 +00:00
Dan Gohman
9e5cc22129 Fix a couple of mistaken switch case fall-throughs. Thanks to Bill
for spotting these!

llvm-svn: 60728
2008-12-08 23:50:06 +00:00
Chris Lattner
23e2ac8894 remove DebugIterations option. Despite the accusations,
jump threading has been shown to only expose problems not
have bugs itself.  I'm sure it's completely bug free! ;-)

llvm-svn: 60725
2008-12-08 22:44:07 +00:00
Evan Cheng
3bb2ad8a0a Re-apply 60689 now my head is screwed on right.
llvm-svn: 60711
2008-12-08 19:29:03 +00:00
Dan Gohman
6f3258586e Fix the top-level comments, and fix some 80-column violations.
llvm-svn: 60707
2008-12-08 17:50:35 +00:00
Dan Gohman
5bca97fc4f Revert 60689. It caused many regressions on Darwin targets.
llvm-svn: 60705
2008-12-08 17:38:02 +00:00
Devang Patel
a8d0117253 Fix spelling.
Thanks Duncan!

llvm-svn: 60702
2008-12-08 17:07:24 +00:00