1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

53992 Commits

Author SHA1 Message Date
Nick Lewycky
4939d449e1 Simplify.
llvm-svn: 86668
2009-11-10 07:00:43 +00:00
Nick Lewycky
f6be02e523 Reapply r86359, "Teach dead store elimination that certain intrinsics write to
memory just like a store" with bug fixed (partial-overwrite.ll is the
regression test).

llvm-svn: 86667
2009-11-10 06:46:40 +00:00
Chris Lattner
9428f34d89 refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.
llvm-svn: 86666
2009-11-10 05:59:26 +00:00
Oscar Fuentes
ce417d0ac2 CMake: Support for building llvm loadable modules.
llvm-svn: 86656
2009-11-10 02:45:37 +00:00
Daniel Dunbar
9b762e5350 lit: Start documentation testing architecture.
llvm-svn: 86655
2009-11-10 02:41:27 +00:00
Daniel Dunbar
fbe1d52c6a lit: Add ExampleTests, for testing lit and demonstrating test suite features.
llvm-svn: 86654
2009-11-10 02:41:17 +00:00
Daniel Dunbar
da307a7868 lit: Fix bug in --show-suites which accidentally override the list of tests.
llvm-svn: 86653
2009-11-10 02:40:21 +00:00
Bruno Cardoso Lopes
b662991460 Fix PR5445
llvm-svn: 86651
2009-11-10 02:35:13 +00:00
Chris Lattner
04da9d4b33 I misread the parens, not so redundant after all.
llvm-svn: 86648
2009-11-10 02:04:54 +00:00
Chris Lattner
f3fc70a936 make jump threading recursively simplify expressions instead of doing it
just one level deep.  On the testcase we go from getting this:

F1:                                               ; preds = %T2
  %F = and i1 true, %cond                         ; <i1> [#uses=1]
  br i1 %F, label %X, label %Y

to a fully threaded:

F1:                                               ; preds = %T2
  br label %Y


This changes gets us to the point where we're forming (too many) switch 
instructions on doug's strswitch testcase.

llvm-svn: 86646
2009-11-10 01:57:31 +00:00
Chris Lattner
fb540241c8 remove some redundant parens.
llvm-svn: 86645
2009-11-10 01:56:04 +00:00
Oscar Fuentes
555721d2c2 CMake: Remove unnecessary `unset' which was not supported by old cmake
releases.

llvm-svn: 86644
2009-11-10 01:45:05 +00:00
Dan Gohman
ae83652ce1 Remove an unused variable.
llvm-svn: 86642
2009-11-10 01:37:57 +00:00
Dan Gohman
4d8fef974a Minor code simplification.
llvm-svn: 86641
2009-11-10 01:36:20 +00:00
Dan Gohman
b4edfdb842 Trim a bunch of unneeded code from this testcase.
llvm-svn: 86640
2009-11-10 01:33:08 +00:00
Chris Lattner
a087a1ca04 don't invalidate PN, rewrite of this code is in progress anyway.
llvm-svn: 86639
2009-11-10 01:19:06 +00:00
Chris Lattner
a279728372 add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
except that the result may not be a constant.  Switch jump threading to 
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.

llvm-svn: 86637
2009-11-10 01:08:51 +00:00
Jeffrey Yasskin
23ac706aab Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Chris Lattner
3730cf6fef factor simplification logic for AND and OR out to InstSimplify from instcombine.
llvm-svn: 86635
2009-11-10 00:55:12 +00:00
David Goodwin
93a4f29c67 Fixed to address code review. No functional changes.
llvm-svn: 86634
2009-11-10 00:48:55 +00:00
Daniel Dunbar
886e51b5c1 Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.

llvm-svn: 86630
2009-11-10 00:43:58 +00:00
David Goodwin
538f9c25f8 Allow targets to specify register classes whose member registers should not be renamed to break anti-dependencies.
llvm-svn: 86628
2009-11-10 00:15:47 +00:00
Chris Lattner
9941f27797 pull a bunch of logic out of instcombine into instsimplify for compare
simplification, this handles the foldable fcmp x,x cases among many others.

llvm-svn: 86627
2009-11-09 23:55:12 +00:00
Dan Gohman
22719d2a1a Pass the (optional) TargetData object to ConstantFoldInstOperands
and ConstantFoldCompareInstOperands.

llvm-svn: 86626
2009-11-09 23:34:17 +00:00
Chris Lattner
9aa69f2205 inline a simple function.
llvm-svn: 86625
2009-11-09 23:31:49 +00:00
Chris Lattner
25700676d4 rename SimplifyCompare -> SimplifyCmpInst and split it into
Simplify[IF]Cmp pieces.  Add some predicates to CmpInst to 
determine whether a predicate is fp or int.

llvm-svn: 86624
2009-11-09 23:28:39 +00:00
Jim Grosbach
ed9f847274 Now that the default is 'enabled,' a separate command line option for ARM is
not necessary.

llvm-svn: 86621
2009-11-09 23:11:45 +00:00
Mike Stump
ee3ba929d0 Add testcase for recent checkin.
llvm-svn: 86620
2009-11-09 23:10:49 +00:00
Chris Lattner
131172dc76 fix ConstantFoldCompareInstOperands to take the LHS/RHS as
individual operands instead of taking a temporary array

llvm-svn: 86619
2009-11-09 23:06:58 +00:00
Daniel Dunbar
e458fe6d8e Add StringSwitch::Cases overloads, for matching multiple strings to a single
value.

llvm-svn: 86618
2009-11-09 23:05:44 +00:00
Chris Lattner
29db7d6abe use instructionsimplify instead of a weak clone of ad-hoc folding stuff.
llvm-svn: 86616
2009-11-09 23:00:14 +00:00
Jim Grosbach
9f37156ae5 Update test
llvm-svn: 86614
2009-11-09 22:59:01 +00:00
Chris Lattner
126d78f1c7 stub out a new libanalysis "instruction simplify" interface that
takes decimated instructions and applies identities to them.  This
is pretty minimal at this point, but I plan to pull some instcombine
logic out into these and similar routines.

llvm-svn: 86613
2009-11-09 22:57:59 +00:00
Jeffrey Yasskin
7ad82ff8cf Remove dlsym stubs, with Nate Begeman's permission.
llvm-svn: 86606
2009-11-09 22:34:19 +00:00
Jim Grosbach
b934f9ccd4 Enable dynamic stack realignment by default.
llvm-svn: 86604
2009-11-09 22:32:40 +00:00
Chris Lattner
8cb0f89bbd stub out a new form of BasicBlock::RemovePredecessorAndSimplify which
simplifies instruction users of PHIs when the phi is eliminated.  This
will be moved to transforms/utils after some other refactoring.

llvm-svn: 86603
2009-11-09 22:32:36 +00:00
Jim Grosbach
3e2968ee4b Set dynamic stack realignment to real values.
llvm-svn: 86602
2009-11-09 22:32:03 +00:00
Dan Gohman
9885f20a6d Remove an unneeded #include.
llvm-svn: 86601
2009-11-09 22:28:30 +00:00
Mike Stump
c2b669b3b2 Fix for 64-bit builds.
llvm-svn: 86600
2009-11-09 22:28:21 +00:00
Bill Wendling
86f32da164 Similar to r86588, but for Darwin this time.
llvm-svn: 86592
2009-11-09 21:45:26 +00:00
Bill Wendling
fab993b096 The jump table was being generated before the end label for exception handling
was generated. This caused code like this:

## The asm code for the function
        .section        __TEXT,__const
        .align  2
lJTI11_0:
LJTI11_0:
        .long    LBB11_16
        .long    LBB11_4
        .long    LBB11_5
        .long    LBB11_6
        .long    LBB11_7
        .long    LBB11_8
        .long    LBB11_9
        .long    LBB11_10
        .long    LBB11_11
        .long    LBB11_12
        .long    LBB11_13
        .long    LBB11_14
Leh_func_end11:   ## <---now in the wrong section!

The `Leh_func_end11' would then end up in the wrong section, causing the
resulting EH frame information to be wrong:

__ZL11CheckRightsjPKcbRbRP6NSData.eh:
    .set    Lset500eh,Leh_frame_end11-Leh_frame_begin11
    .long   Lset500eh  ; Length of Frame Information Entry                                                                                                                   
Leh_frame_begin11:
    .long   Leh_frame_begin11-Leh_frame_common
    .long   Leh_func_begin11-.
    .set    Lset501eh,Leh_func_end11-Leh_func_begin11
    .long   Lset501eh                                   ; FDE address range                                                                                                                                   
`Lset501eh' is now something huge instead of the real value.

The X86 back-end generates the jump table after the EH information is
emitted. Do the same here.

llvm-svn: 86588
2009-11-09 21:20:14 +00:00
Dan Gohman
c64e578e5a Print "..." instead of all the uninteresting register clobbers on call
instructions. This makes CodeGen dumps significantly less noisy.

Example before:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def,dead>, %D1<imp-def,dead>, %D2<imp-def,dead>, %D3<imp-def,dead>, %D4<imp-def,dead>, %D5<imp-def,dead>, %D6<imp-def,dead>, %D7<imp-def,dead>, %D16<imp-def,dead>, %D17<imp-def,dead>, %D18<imp-def,dead>, %D19<imp-def,dead>, %D20<imp-def,dead>, %D21<imp-def,dead>, %D22<imp-def,dead>, %D23<imp-def,dead>, %D24<imp-def,dead>, %D25<imp-def,dead>, %D26<imp-def,dead>, %D27<imp-def,dead>, %D28<imp-def,dead>, %D29<imp-def,dead>, %D30<imp-def,dead>, %D31<imp-def,dead>, %CPSR<imp-def,dead>, %FPSCR<imp-def,dead>

Same example after:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %LR<imp-def,dead>, %CPSR<imp-def,dead>, ...

llvm-svn: 86583
2009-11-09 19:38:45 +00:00
Dan Gohman
6780148e20 Default-addressspace null pointers don't alias anything. This allows
GVN to be more aggressive. Patch by Hans Wennborg! (with a comment added by me)

llvm-svn: 86582
2009-11-09 19:29:11 +00:00
David Goodwin
2c17fdab6d Fix dependencies added to model memory aliasing for post-RA scheduling. The dependencies were overly conservative for memory access that are known not to alias.
llvm-svn: 86580
2009-11-09 19:22:17 +00:00
Dan Gohman
b696ff22f7 The inbounds keyword isn't relevant to overindexing of
static array types. Thanks to Duncan for pointing this out!

llvm-svn: 86576
2009-11-09 19:01:53 +00:00
Dan Gohman
7010cad26a Fix a comment in a typo that Duncan noticed.
llvm-svn: 86575
2009-11-09 18:59:22 +00:00
Dan Gohman
e2afe7c1c7 Remove the "special case" for zero-length arrays, and rephrase this
paragraph to be more precise.

llvm-svn: 86572
2009-11-09 18:40:39 +00:00
Dan Gohman
457b8bad4e Generalize LCSSA to handle loops with exits with predecessors outside
the loop. This is needed because with indirectbr it may not be possible
for LoopSimplify to guarantee that all loop exit predecessors are
inside the loop. This fixes PR5437.

LCCSA no longer actually requires LoopSimplify form, but for now it
must still have the dependency because the PassManager doesn't know
how to schedule LoopSimplify otherwise.

llvm-svn: 86569
2009-11-09 18:28:24 +00:00
Dan Gohman
141625abc4 Fix an 80-column violation.
llvm-svn: 86567
2009-11-09 18:20:38 +00:00
Dan Gohman
68d528963c Minor tidiness fixes.
llvm-svn: 86565
2009-11-09 18:19:43 +00:00