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

60216 Commits

Author SHA1 Message Date
Dan Gohman
66c6519877 Silence warnings about -1 being converted to an unsigned value.
Also, pass true for isSigned even when creating constants for unsigned
comparisons, because the point is to create an all-ones constant,
rather than UINT64_MAX, even for integers wider than 64 bits.

llvm-svn: 102946
2010-05-03 20:23:47 +00:00
Eric Christopher
3496e7c880 Add an option, defaulting to off, to disable the sse domain crossing opts.
llvm-svn: 102941
2010-05-03 19:54:02 +00:00
Devang Patel
fa560fdfc1 Check for side effects before splitting loop.
Patch by Jakub Staszak!

llvm-svn: 102928
2010-05-03 18:06:58 +00:00
Dan Gohman
51faf74c7d Use isTrueWhenEqual and isFalseWhenEqual instead of assuming that
SimplifyICmpOperands will simplify such cases to EQ or NE. This makes
the correcntess of the code independent on SimplifyICmpOperands doing
certain simplifications.

llvm-svn: 102927
2010-05-03 18:00:24 +00:00
Dan Gohman
b4fdc7ea81 In ScalarEvolution::print, don't bother printing out the SCEVs for
comparison instructions, since they aren't interesting, despite having
integer result types.

llvm-svn: 102925
2010-05-03 17:03:23 +00:00
Dan Gohman
043875bc90 In SimplifyICmpOperands, avoid needlessly swapping the operands in the
case where both are addrecs in unrelated loops.

llvm-svn: 102924
2010-05-03 17:00:11 +00:00
Dan Gohman
02c26ed601 Factor out the new <= and >= analysis code into SimplifyICmpOperands.
llvm-svn: 102922
2010-05-03 16:35:17 +00:00
Dan Gohman
85561664d5 Update this comment to note its relationship with the "happens-before"
concept in the proposed memory model changes.

llvm-svn: 102911
2010-05-03 14:59:34 +00:00
Dan Gohman
62ea5f981d Delete this comment. The behavior of struct loads and stores with
respect to padding bytes isn't something that the dependence text
needs to spell out.

llvm-svn: 102910
2010-05-03 14:58:14 +00:00
Dan Gohman
cb5781826c Describe invoke instruction dependencies. Generalize the text for
terminator instructions so that it applies to all terminators with
multiple successors, including invoke.

llvm-svn: 102909
2010-05-03 14:55:22 +00:00
Dan Gohman
55e93b2802 Say "operations" instead of "instructions", as nsw can be applied to
constant expressions as well as instructions.

llvm-svn: 102908
2010-05-03 14:51:43 +00:00
Dan Gohman
15cb983f55 Fix a bug which prevented tail merging of return instructions in
beneficial cases. See the changes in test/CodeGen/X86/tail-opts.ll and
test/CodeGen/ARM/ifcvt2.ll for details.

The fix is to change HashEndOfMBB to hash at most one instruction,
instead of trying to apply heuristics about when it will be profitable to
consider more than one instruction. The regular tail-merging heuristics
are already prepared to handle the same cases, and they're more precise.

Also, make test/CodeGen/ARM/ifcvt5.ll and
test/CodeGen/Thumb2/thumb2-branch.ll slightly more complex so that they
continue to test what they're intended to test.

And, this eliminates the problem in
test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll, the testcase from
PR5204. Update it accordingly.

llvm-svn: 102907
2010-05-03 14:35:47 +00:00
Dan Gohman
4f9dc00cec Add a README entry.
llvm-svn: 102906
2010-05-03 14:31:00 +00:00
Duncan Sands
153ad3b903 Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.

llvm-svn: 102865
2010-05-02 15:36:26 +00:00
Chris Lattner
1452a149f0 fix some inconsistent line endings, patch by Jakub Staszak!
llvm-svn: 102852
2010-05-01 17:36:49 +00:00
Chris Lattner
afaee8e110 revert r102831. We already delete dead readonly calls in
other places, killing a valid transformation is not the right
answer.

llvm-svn: 102850
2010-05-01 17:19:38 +00:00
Dale Johannesen
a8f83a5f1b Don't count debug info as instructions. This was
preventing the emission of the NOP on Darwin for a
function with no actual code.  From timberwolfmc
with TEST=optllcdbg.

llvm-svn: 102843
2010-05-01 16:41:11 +00:00
David Chisnall
52a91e993b Added a variant of InlineCostAnalyzer::getInlineCost() that takes the called function as an explicit argument, for use when inlining function pointers.
llvm-svn: 102841
2010-05-01 15:47:41 +00:00
Anton Korobeynikov
a3726088fa Insert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1),
when needed. This fixes PR7001

llvm-svn: 102838
2010-05-01 12:52:34 +00:00
Anton Korobeynikov
f31181a0cc Do folding for indirect branches, where possible
llvm-svn: 102836
2010-05-01 12:28:21 +00:00
Anton Korobeynikov
9b724bd446 Implement indirect branches on MSP430
llvm-svn: 102835
2010-05-01 12:04:32 +00:00
Anton Korobeynikov
7a84875b09 Long branch target oparands are not pc-rel.
This should fix PR6603.

llvm-svn: 102834
2010-05-01 12:04:22 +00:00
Owen Anderson
443d813b45 Disable the call-deletion transformation introduced in r86975. Without
halting analysis, it is illegal to delete a call to a read-only function.
The correct solution is almost certainly to add a "must halt" attribute and
only allow deletions in its presence.

XFAIL the relevant testcase for now.

llvm-svn: 102831
2010-05-01 08:34:28 +00:00
Chris Lattner
61a8beaae0 fix PR5009 by making CGSCCPM realize that a call was devirtualized
if an indirect call site was removed and a direct one was added, not
just if an indirect call site was modified to be direct.

llvm-svn: 102830
2010-05-01 06:38:43 +00:00
Chris Lattner
660cc3ac57 rename test
llvm-svn: 102829
2010-05-01 06:34:13 +00:00
Dan Gohman
ada97c52fe Remove the code for special-casing byval for fast-isel. SelectionDAG
handles argument lowering anyway, so there's no need for special
casing here.

llvm-svn: 102828
2010-05-01 02:44:23 +00:00
Dan Gohman
11b3613649 Fix an ancient FIXME.
llvm-svn: 102827
2010-05-01 02:43:10 +00:00
Dan Gohman
fb5d6a5d70 Re-disable kill flags, as there is more trouble.
llvm-svn: 102826
2010-05-01 01:57:56 +00:00
Chris Lattner
66d1a6ad69 rename InlineInfo.DevirtualizedCalls -> InlinedCalls to
reflect that it includes all inlined calls now, not just
devirtualized ones.

llvm-svn: 102824
2010-05-01 01:26:13 +00:00
Chris Lattner
9ee72a47c2 Implement rdar://6295824 and PR6724 with two tiny changes
that can have a big effect :).  The first is to enable the
iterative SCC passmanager juice that kicks in when the
scc passmgr detects that a function pass has devirtualized
a call.  In this case, it will rerun all the passes it 
manages on the SCC, up to the iteration count limit (4). This
is useful because a function pass may devirualize a call, and
we want the inliner to inline it, or pruneeh to infer stuff
about it, etc.

The second patch is to add *all* call sites to the 
DevirtualizedCalls list the inliner uses.  This list is
about to get renamed, but the jist of this is that the 
inliner now reconsiders *all* inlined call sites as candidates
for further inlining.  The intuition is this that in cases 
like this:

f() { g(1); }     g(int x) { h(x); }

We analyze this bottom up, and may decide that it isn't 
profitable to inline H into G.  Next step, we decide that it is
profitable to inline G into F, and do so, which means that F 
now calls H.  Even though the call from G -> H may not have been
profitable to inline, the call from F -> H may be (in this case
because a constant allows folding etc).

In my spot checks, this doesn't have a big impact on code.  For
example, the LLC output for 252.eon grew from 0.02% (from
317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612
to 1520964 bytes).  252.eon never iterated in the SCC Passmgr,
176.gcc iterated at most 1 time.

llvm-svn: 102823
2010-05-01 01:15:56 +00:00
Chris Lattner
b893cedad2 The inliner has traditionally not considered call sites
that appear due to inlining a callee as candidates for
futher inlining, but a recent patch made it do this if
those call sites were indirect and became direct.

Unfortunately, in bizarre cases (see testcase) doing this
can cause us to infinitely inline mutually recursive
functions into callers not in the cycle.  Fix this by
keeping track of the inline history from which callsite
inline candidates got inlined from.

This shouldn't affect any "real world" code, but is required
for a follow on patch that is coming up next.

llvm-svn: 102822
2010-05-01 01:05:10 +00:00
Dan Gohman
5fc96b81ec Re-enable kill flags from SelectionDAGISel, with a fix: don't
try to put a kill flag on a DBG_INFO instruction.

llvm-svn: 102820
2010-05-01 00:50:53 +00:00
Dale Johannesen
c0bf114984 Fix a bug where debug info affected stack slot coloring.
Seen in SingleSrc/Benchmarks/Misc/flops with TEST=optllcdbg.
7929951.

llvm-svn: 102819
2010-05-01 00:41:15 +00:00
Dan Gohman
1a6c7dfb3e Fix whitespace.
llvm-svn: 102817
2010-05-01 00:33:28 +00:00
Dan Gohman
37fe41a8c0 Don't pass SDValues by non-const reference unless they may be
modified.

llvm-svn: 102816
2010-05-01 00:33:16 +00:00
Evan Cheng
8bd004b033 Add a pseudo instruction REG_SEQUENCE that takes a list of registers and
sub-register indices and outputs a single super register which is formed from
a consecutive sequence of registers.

This is used as register allocation / coalescing aid and it is useful to
represent instructions that output register pairs / quads. For example,
v1024, v1025 = vload <address>
where v1024 and v1025 forms a register pair.

This really should be modelled as
v1024<3>, v1025<4> = vload <address>
but it would violate SSA property before register allocation is done.

Currently we use insert_subreg to form the super register:
v1026 = implicit_def
v1027 - insert_subreg v1026, v1024, 3
v1028 = insert_subreg v1027, v1025, 4
...
      = use v1024
      = use v1028

But this adds pseudo live interval overlap between v1024 and v1025.

We can now modeled it as
v1024, v1025 = vload <address>
v1026 = REG_SEQUENCE v1024, 3, v1025, 4
...
      = use v1024
      = use v1026

After coalescing, it will be
v1026<3>, v1025<4> = vload <address>
...
      = use v1026<3>
      = use v1026

llvm-svn: 102815
2010-05-01 00:28:44 +00:00
Dan Gohman
0561bd78d0 Reorgnaize more switch code lowering to clean up some tricky
code, and to eliminate the need for the SelectionDAGBuilder
state to be live during CodeGenAndEmitDAG calls.

Call SDB->clear() before CodeGenAndEmitDAG calls instead of
before it, and move the CurDAG->clear() out of SelectionDAGBuilder,
which doesn't own the DAG, and into CodeGenAndEmitDAG.

llvm-svn: 102814
2010-05-01 00:25:44 +00:00
Bill Wendling
7b6527b94b Test failing too much on too many platforms.
llvm-svn: 102812
2010-05-01 00:12:33 +00:00
Dan Gohman
d59de31ce2 Delete the EdgeMapping variable itself.
llvm-svn: 102810
2010-05-01 00:02:20 +00:00
Dan Gohman
68f04d06c8 Get rid of the EdgeMapping map. Instead, just check for BasicBlock
changes before doing phi lowering for switches.

llvm-svn: 102809
2010-05-01 00:01:06 +00:00
Daniel Dunbar
deb67461c0 Update for CIndex rename.
llvm-svn: 102803
2010-04-30 23:36:47 +00:00
Bill Wendling
a348ff69b8 Maybe it needs sse2?
llvm-svn: 102802
2010-04-30 23:19:29 +00:00
Bill Wendling
d1c5f11f72 Force 64-bit.
llvm-svn: 102800
2010-04-30 22:45:20 +00:00
Dan Gohman
9281e7be3e Fix a typo.
llvm-svn: 102799
2010-04-30 22:38:11 +00:00
Chris Lattner
3eb6a9f076 Dan recently disabled recursive inlining within a function, but we
were still inlining self-recursive functions into other functions.

Inlining a recursive function into itself has the potential to
reduce recursion depth by a factor of 2, inlining a recursive
function into something else reduces recursion depth by exactly 
1.  Since inlining a recursive function into something else is a
weird form of loop peeling, turn this off.

The deleted testcase was added by Dale in r62107, since then
we're leaning towards not inlining recursive stuff ever.  In any
case, if we like inlining recursive stuff, it should be done 
within the recursive function itself to get the algorithm 
recursion depth win.

llvm-svn: 102798
2010-04-30 22:37:22 +00:00
Bill Wendling
95a4929ac7 EXTRACT_VECTOR_ELT of an INSERT_VECTOR_ELT may have the same index, but the
indexes could be of a different value type. Or not even using the same SDNode
for the constant (weird, I know). Compare the actual values instead of the
pointers.

llvm-svn: 102791
2010-04-30 22:19:17 +00:00
Daniel Dunbar
8427c19fe2 Don't use 'else ifdef', I guess this is a 3.81 feature?
llvm-svn: 102781
2010-04-30 22:00:17 +00:00
Dan Gohman
e980525516 Remove this debug output. The MachineFunction will be printed once all of
instruction selection is done; it's confusing to see parts of it printed,
while other parts are omitted, along the way.

llvm-svn: 102771
2010-04-30 21:21:21 +00:00
Jakob Stoklund Olesen
fac584ed9e The local register allocator has to spill dirty callee saved registers before a
call that might throw. The landing pad assumes that all registers are in stack
slots.

We used to spill those dirty CSRs after the call, and the stack slots would be
wrong when arriving at the landing pad.

llvm-svn: 102770
2010-04-30 21:19:29 +00:00
Dan Gohman
73722062f7 Update BitVectorTest.cpp to stay in sync with SmallBitVectorTest.cpp,
and fix a bug in BitVector's reference proxy class which this exposed.

llvm-svn: 102768
2010-04-30 20:50:28 +00:00