1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

3953 Commits

Author SHA1 Message Date
Nick Lewycky
39b165bb7d Fix flipped sign. While there, show my math.
llvm-svn: 139135
2011-09-06 05:33:18 +00:00
Nick Lewycky
fdc650ea7a No no no, fix typo properly!
llvm-svn: 139134
2011-09-06 05:08:09 +00:00
Nick Lewycky
3823432a57 The logic inside getMulExpr to simplify {a,+,b}*{c,+,d} was wrong, which was
visible given a=b=c=d=1, on iteration #1 (the second iteration). Replace it with
correct math. Fixes PR10383!

llvm-svn: 139133
2011-09-06 05:05:14 +00:00
Nick Lewycky
18c0b01a56 Revert r139126 due to selfhost failures reported by buildbots.
llvm-svn: 139130
2011-09-06 02:43:13 +00:00
Nick Lewycky
30dcc754df Teach SCEV to report a max backedge count in one interesting case in
HowFarToZero; the case for a canonical loop.

llvm-svn: 139126
2011-09-05 23:25:16 +00:00
Benjamin Kramer
ec933b857e InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.
Fixes clang selfhost.

llvm-svn: 139120
2011-09-05 18:16:19 +00:00
Duncan Sands
a74d10bb60 Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg.

llvm-svn: 139113
2011-09-05 06:52:48 +00:00
Benjamin Kramer
0c1a5d2067 Use canonical forms for the branch probability zero heutistic.
- Drop support for X >u 0, it's equivalent to X != 0 and should be canonicalized into the latter.
- Add X < 1 -> unlikely, which is what instcombine canonicalizes X <= 0 into.
- Add X > -1 -> likely, which is what instcombine canonicalizes X >= 0 into.

llvm-svn: 139110
2011-09-04 23:53:04 +00:00
Andrew Trick
43d88c3879 Comment and clarifying assert.
llvm-svn: 139036
2011-09-02 21:20:46 +00:00
Devang Patel
26f7aeed7c After r138010, subroutine type does not have context info. Update type verifier accordingly.
This fixes ptype.exp gdb testsuite regressions.

llvm-svn: 138869
2011-08-31 18:04:31 +00:00
Nadav Rotem
43912ff374 Fixes following the CR by Chris and Duncan:
Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.

llvm-svn: 138756
2011-08-29 19:58:36 +00:00
Andrew Trick
026fa4da72 Reapply r138695. Fix PassManager stack depths.
Patch by Xiaoyi Guo!

llvm-svn: 138737
2011-08-29 17:07:00 +00:00
Nadav Rotem
6280c8eecc Bitcasts are transitive. Bitcast-Bitcast-X becomes Bitcast-X.
llvm-svn: 138722
2011-08-28 11:51:08 +00:00
Andrew Trick
65754eb3f7 Reverting r138695 to see if it fixes clang self host.
llvm-svn: 138701
2011-08-27 06:10:16 +00:00
Andrew Trick
e38568bc07 Fix PassManager stack depths.
Patch by Xiaoyi Guo!

llvm-svn: 138695
2011-08-27 02:11:03 +00:00
Eric Christopher
09fd6a961c Whitespace and 80-col.
llvm-svn: 138654
2011-08-26 21:02:40 +00:00
Andrew Trick
504187a152 LoopInfo::updateUnloop fix, and verify Block->Loop maps.
Fixes an oversight, and adds verification to catch it in the unloop.ll tests.

llvm-svn: 138622
2011-08-26 03:06:34 +00:00
Bill Wendling
15062f817a Skip the landingpad instruction when determining the insertion point.
llvm-svn: 138481
2011-08-24 21:06:46 +00:00
Nadav Rotem
43673d6d0b Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.
llvm-svn: 138469
2011-08-24 20:18:38 +00:00
Eric Christopher
aa4993b9aa Revert "Address Duncan's CR request:"
This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340)

Conflicts:

	test/Transforms/InstCombine/bitcast.ll

llvm-svn: 138366
2011-08-23 20:11:10 +00:00
Nadav Rotem
d449bc9bff Address Duncan's CR request:
1. Cleanup the tests in ConstantFolding.cpp
2. Implement isAllOnes for Constant, ConstantFP, ConstantVector

llvm-svn: 138340
2011-08-23 17:48:43 +00:00
Nadav Rotem
1dc1eb1ae0 Add constant folding support for bitcasts of splat vectors to integers.
llvm-svn: 138206
2011-08-20 14:02:29 +00:00
Devang Patel
e4127d626e Do not use named md nodes to track variables that are completely optimized. This does not scale while doing LTO with debug info. New approach is to include list of variables in the subprogram info directly.
llvm-svn: 138145
2011-08-19 23:28:12 +00:00
Benjamin Kramer
0d60a5573c Make a bunch of symbols private.
llvm-svn: 138025
2011-08-19 01:42:18 +00:00
Benjamin Kramer
c5a90f3683 C API functions must be able to see their extern "C" definitions, or it will be impossible to call them from C.
llvm-svn: 138022
2011-08-19 01:36:54 +00:00
Devang Patel
9fa42d022b There is no need to add file as context for subroutine type. The subroutine type does not need any context.
llvm-svn: 138010
2011-08-18 23:50:57 +00:00
Bill Wendling
3566980062 Revert r137655. There is some question about whether the 'landingpad'
instruction should be marked as potentially reading and/or writing memory.

llvm-svn: 137863
2011-08-17 20:36:44 +00:00
Eli Friedman
6da9a85aaa Revert r137781; I agree with Duncan's comment that the situation in question is clearly impossible given the current structure of the code.
llvm-svn: 137853
2011-08-17 19:31:49 +00:00
Eli Friedman
fc821baad4 Extend the undef ^ undef idiom once more. No testcase: I can't figure out how to actually trigger the codepath in question at the moment, but it might get exposed in the future.
llvm-svn: 137781
2011-08-16 22:38:34 +00:00
Devang Patel
630d8ce36b Until now all debug info MDNodes referred to a root MDNode, a compile unit. This simplified handling of these needs in dwarf writer. However, one side effect of this is that during link time optimization all these MDNodes are _not_ uniqued. In other words there will be N number of MDNodes describing "int", "char" and all other types, which would suddenly grow when each object file starts using libraries like STL.
MDNodes graph structure such that compiler unit keeps track of important MDNodes and update dwarf writer to process mdnodes top-down instead of bottom up.

llvm-svn: 137778
2011-08-16 22:09:43 +00:00
Bill Wendling
3d7b8eaa78 Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'
check for a LandingPadInst.

llvm-svn: 137745
2011-08-16 20:45:24 +00:00
Bill Wendling
3e159bd43d A few places where we want to skip the landingpad instruction for insertion.
llvm-svn: 137712
2011-08-16 04:52:55 +00:00
Devang Patel
f1b61abc8c Add a finalize() hook, that'll let DIBuilder construct compile unit lazily.
llvm-svn: 137673
2011-08-15 23:00:00 +00:00
Eli Friedman
a88908f4e7 Add some comments here because the lack of a check for volatile/atomic here is a bit unusual.
llvm-svn: 137662
2011-08-15 21:56:39 +00:00
Bill Wendling
a75d2d0416 Duncan pointed out that the LandingPadInst might read memory. (It might also
write to memory.) Marking it as such makes some checks for immobility go away.

llvm-svn: 137655
2011-08-15 21:14:31 +00:00
Eli Friedman
5acfaeab2d Misc analysis passes that need to be aware of atomic load/store.
llvm-svn: 137650
2011-08-15 20:54:19 +00:00
Eli Friedman
e18709e5b2 Atomic load/store support in LICM.
llvm-svn: 137648
2011-08-15 20:52:09 +00:00
Bill Wendling
8cc5168e87 The landingpad instruction isn't loop-invariant.
llvm-svn: 137628
2011-08-15 18:22:49 +00:00
Devang Patel
1b73744344 Refactor. Global variables are part of compile unit so let CompileUnit create new global variable.
llvm-svn: 137621
2011-08-15 17:57:41 +00:00
Duncan Sands
10a9e984bc Silence a bunch (but not all) "variable written but not read" warnings
when building with assertions disabled.

llvm-svn: 137460
2011-08-12 14:54:45 +00:00
Andrew Trick
5a5a5ebe68 Allow loop unrolling to get known trip counts from ScalarEvolution.
SCEV unrolling can unroll loops with arbitrary induction variables. It
is a prerequisite for -disable-iv-rewrite performance. It is also
easily handles loops of arbitrary structure including multiple exits
and is generally more robust.

This is under a temporary option to avoid affecting default
behavior for the next couple of weeks. It is needed so that I can
checkin unit tests for updateUnloop.

llvm-svn: 137384
2011-08-11 23:36:16 +00:00
Andrew Trick
b31724d9ff Fix for LoopInfo::updateUnloop. Remove subloop blocks from former
ancestor loops.

I have a unit test that depends on scev-unroll, which unfortunately
isn't checked in. But I will check it in when I can.

llvm-svn: 137341
2011-08-11 20:27:32 +00:00
Andrew Trick
eb6a7aad9e Cleanup. Another thorough review by Nick!
llvm-svn: 137317
2011-08-11 17:54:58 +00:00
Andrew Trick
306e3d0508 Reapplying r136844.
An algorithm for incrementally updating LoopInfo within a
LoopPassManager. The incremental update should be extremely cheap in
most cases and can be used in places where it's not feasible to
regenerate the entire loop forest.

- "Unloop" is a node in the loop tree whose last backedge has been removed.
- Perform reverse dataflow on the block inside Unloop to propagate the
  nearest loop from the block's successors.
- For reducible CFG, each block in unloop is visited exactly
  once. This is because unloop no longer has a backedge and blocks
  within subloops don't change parents.
- Immediate subloops are summarized by the nearest loop reachable from
  their exits or exits within nested subloops.
- At completion the unloop blocks each have a new parent loop, and
  each immediate subloop has a new parent.

llvm-svn: 137276
2011-08-10 23:22:57 +00:00
Devang Patel
1541972a13 Distinguish between two copies of one inlined variable. Take 2.
llvm-svn: 137253
2011-08-10 21:50:54 +00:00
Andrew Trick
d10d5f0609 Cleanup. Added LoopBlocksDFS::perform for simple clients.
llvm-svn: 137195
2011-08-10 01:59:05 +00:00
Devang Patel
1d038e6e01 Provide method to print variable's extended name which includes inline location.
llvm-svn: 137095
2011-08-09 01:03:14 +00:00
Andrew Trick
a7fc7983d4 Made SCEV's UDiv expressions more canonical. When dividing a
recurrence, the initial values low bits can sometimes be ignored.

To take advantage of this, added FoldIVUser to IndVarSimplify to fold
an IV operand into a udiv/lshr if the operator doesn't affect the
result.

-indvars -disable-iv-rewrite now transforms

i = phi i4
i1 = i0 + 1
idx = i1 >> (2 or more)
i4 = i + 4

into

i = phi i4
idx = i0 >> ...
i4 = i + 4

llvm-svn: 137013
2011-08-06 07:00:37 +00:00
Chandler Carruth
e833bbd11e Temporarily revert r135528 which distinguishes between two copies of one
inlined variable, based on the discussion in PR10542.

This explodes the runtime of several passes down the pipeline due to
a large number of "copies" remaining live across a large function. This
only shows up with both debug and opt, but when it does it creates
a many-minute compile when self-hosting LLVM+Clang. There are several
other cases that show these types of regressions.

All of this is tracked in PR10542, and progress is being made on fixing
the issue. Once its addressed, the re-instated, but until then this
restores the performance for self-hosting and other opt+debug builds.

Devang, let me know if this causes any trouble, or impedes fixing it in
any way, and thanks for working on this!

llvm-svn: 136953
2011-08-05 00:51:31 +00:00
Duncan Sands
be4435d95e Fix what seems an obvious typo. Patch by Ivan Krasin. Problem
reported at http://habrahabr.ru/blogs/compilers/125626/.

llvm-svn: 136865
2011-08-04 10:02:21 +00:00