1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

23512 Commits

Author SHA1 Message Date
Owen Anderson
673cae8561 In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
the entries.  This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.

llvm-svn: 52690
2008-06-24 21:58:29 +00:00
Owen Anderson
8b2f51618a Use SmallVector instead of std::vector for a minor compile time improvement.
llvm-svn: 52689
2008-06-24 21:44:59 +00:00
Dan Gohman
b9384c5e87 Revert 52645, the loop unroller changes. It caused a regression in 252.eon.
llvm-svn: 52688
2008-06-24 20:44:42 +00:00
Dan Gohman
e9f0a28c64 Fix a typo in a comment.
llvm-svn: 52687
2008-06-24 18:00:21 +00:00
Dan Gohman
fcb2dc2dd6 Use const_cast instead of a C-style cast.
llvm-svn: 52684
2008-06-24 17:47:37 +00:00
Matthijs Kooijman
ff03ea8aeb Commit the new DeadArgElim pass again, this time with the gcc bootstrap failures fixed.
Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form.

llvm-svn: 52677
2008-06-24 16:30:26 +00:00
Matthijs Kooijman
bb456f6b42 Rename a few variables to be more consistent.
llvm-svn: 52672
2008-06-24 09:14:10 +00:00
Evan Cheng
a62f5f0f82 If it's determined safe, remat MOV32r0 (i.e. xor r, r) and others as it is instead of using the longer MOV32ri instruction.
llvm-svn: 52670
2008-06-24 07:10:51 +00:00
Dan Gohman
29c5903a80 Fix some signed vs. unsigned issues in array and vector handling.
llvm-svn: 52664
2008-06-24 01:17:52 +00:00
Dan Gohman
9941a2dab3 Add a note about a potential PIC optimization.
llvm-svn: 52663
2008-06-24 00:53:07 +00:00
Dan Gohman
ebc59c90b7 Fixes for being compiled PIC on Linux. This isn't the most
general solution possible, but it's a fairly simple one.
Based on a patch from the OpenGTL project!

llvm-svn: 52662
2008-06-24 00:50:01 +00:00
Dan Gohman
0e992740a0 A brief survey of priority_queue usage in the tree turned this up
as a questionable case, but the code isn't actually needed.

llvm-svn: 52657
2008-06-23 23:51:16 +00:00
Bill Wendling
2501066409 This situation can occur:
,------.
    |      |
    |      v
    |   t2 = phi ... t1 ...
    |      |
    |      v
    |   t1 = ...
    |  ... = ... t1 ...
    |      |
    `------'

where there is a use in a PHI node that's a predecessor to the defining
block. We don't want to mark all predecessors as having the value "alive" in
this case. Also, the assert was too restrictive and didn't handle this case.

llvm-svn: 52655
2008-06-23 23:41:14 +00:00
Dan Gohman
95743e3078 Use the new PriorityQueue in ScheduleDAGList too, which also
needs arbitrary-element removal.

llvm-svn: 52654
2008-06-23 23:40:09 +00:00
Dan Gohman
11d367fd0c Use use_empty() instead of getNumUses(), avoiding a use list traversal.
llvm-svn: 52651
2008-06-23 23:23:49 +00:00
Owen Anderson
f2386cff4f Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block.
llvm-svn: 52649
2008-06-23 22:12:23 +00:00
Dan Gohman
24ec9f54bc Fix spelling and grammar in a comment.
llvm-svn: 52648
2008-06-23 22:11:52 +00:00
Dan Gohman
7f6ee1cd4b Revamp the loop unroller, extending it to correctly update PHI nodes
in the presence of out-of-loop users of in-loop values and the trip
count is not a known multiple of the unroll count, and to be a bit
simpler overall. This fixes PR2253.

llvm-svn: 52645
2008-06-23 21:29:41 +00:00
Evan Cheng
73bdede529 Remove option used to debug stack coloring bugs. It's no longer needed since stack coloring is now bug free.
llvm-svn: 52644
2008-06-23 21:24:32 +00:00
Evan Cheng
174f11c202 Disable PRE. It's breaking bootstrapping.
llvm-svn: 52643
2008-06-23 21:22:35 +00:00
Dan Gohman
71a0e81d0b Move a DenseMap's declaration outside of a loop, and just call
clear() on each iteration. This avoids allocating and deallocating
all of DenseMap's memory on each iteration.

llvm-svn: 52642
2008-06-23 21:15:00 +00:00
Evan Cheng
6e5a126667 Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
llvm-svn: 52639
2008-06-23 21:03:19 +00:00
Wojciech Matyjewicz
1de28ac425 First step to fix PR2088. Implement routine to compute the
multiplicative inverse of a given number. Modify udivrem to allow input and 
output pairs of arguments to overlap. Patch is based on the work by Chandler
Carruth.

llvm-svn: 52638
2008-06-23 19:39:50 +00:00
Dan Gohman
5a929b928e Update the .cvs files.
llvm-svn: 52637
2008-06-23 18:43:26 +00:00
Dan Gohman
7492d685c7 Fix the types for NumElements variables, and add a comment
explaining why empty array constants use ValID::createUndef().

llvm-svn: 52636
2008-06-23 18:40:28 +00:00
Owen Anderson
0dcae02ad4 Tighten the conditions under which we do PRE, remove some unneeded code, and correct our preserved analyses list, since we
do now change the CFG by splitting critical edges during PRE.

llvm-svn: 52631
2008-06-23 17:49:45 +00:00
Chris Lattner
b992911447 minor tidying of comments.
llvm-svn: 52630
2008-06-23 17:11:23 +00:00
Dan Gohman
b52f318a0c Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.

llvm-svn: 52629
2008-06-23 16:48:17 +00:00
Dan Gohman
12a793b025 Use std::copy instead of a loop.
llvm-svn: 52628
2008-06-23 16:45:24 +00:00
Dan Gohman
d9e2c8b72a More changes from Chris' review: simplify getIndices and avoid
copying its return value.

llvm-svn: 52627
2008-06-23 16:39:44 +00:00
Dan Gohman
84cef04f76 Duncan pointed out this code could be tidied.
llvm-svn: 52624
2008-06-23 15:29:14 +00:00
Duncan Sands
e7f2c80a8c Port some integer multiplication fixes from LegalizeDAG.
Bail out with an error if there is no libcall available
for the given size of integer.

llvm-svn: 52622
2008-06-23 15:15:44 +00:00
Duncan Sands
86e6f1a3b6 Support for expanding the result of EXTRACT_ELEMENT.
llvm-svn: 52621
2008-06-23 15:08:15 +00:00
Duncan Sands
1b83cbdebe Cleanup up LegalizeTypes handling of loads and
stores.

llvm-svn: 52620
2008-06-23 14:19:45 +00:00
Owen Anderson
7d4e8f976c At Chris' suggestion, move the liveness and worklist datastructures into
instance variables so they can be allocated just once, and reuse the worklist
as the dead list as well.

llvm-svn: 52618
2008-06-23 06:13:12 +00:00
Dan Gohman
62d8bc0480 Improve LSR's dead-phi detection to handle use-def cycles
with more than two nodes.

llvm-svn: 52617
2008-06-22 20:44:02 +00:00
Dan Gohman
4ada89e819 Use Loop::block_iterator.
llvm-svn: 52616
2008-06-22 20:18:58 +00:00
Dan Gohman
90894ac18b Generalize createSCEV to be able to form SCEV expressions from
ConstantExprs.

llvm-svn: 52615
2008-06-22 19:56:46 +00:00
Dan Gohman
81c83d9a1d Use SCEVAddRecExpr::isAffine.
llvm-svn: 52614
2008-06-22 19:23:09 +00:00
Dan Gohman
c1aa753f00 Remove unnecessary #includes.
llvm-svn: 52613
2008-06-22 19:21:26 +00:00
Dan Gohman
311865bd24 Move a few more SCEVExpander methods out-of-line.
llvm-svn: 52612
2008-06-22 19:09:18 +00:00
Chris Lattner
d80c865a09 Fix PR2369 by making scalarrepl more careful about promoting
structures.  Its default threshold is to promote things that are
smaller than 128 bytes, which is sane.  However, it is not sane
to do this for things that turn into 128 *registers*.  Add a cap
on the number of registers introduced, defaulting to 128/4=32.

llvm-svn: 52611
2008-06-22 17:46:21 +00:00
Duncan Sands
d1d3e67d30 Make custom lowering of ADD work correctly. This
fixes PR2476; patch by Richard Osborne.  The same
problem exists for a bunch of other operators, but
I'm ignoring this because they will be automagically
fixed when the new LegalizeTypes infrastructure lands,
since it already solves this problem centrally.

llvm-svn: 52610
2008-06-22 09:42:16 +00:00
Eli Friedman
369401ef95 Fix for PR2479: correctly optimize expressions like (a > 13) & (a ==
15).

See also PR1800, which is about the signed case.

llvm-svn: 52608
2008-06-21 23:36:13 +00:00
Dan Gohman
91a43b082c Use Instruction::eraseFromParent().
llvm-svn: 52606
2008-06-21 22:08:46 +00:00
Dan Gohman
e0744f181b Use Function's arg_size() and size() methods.
llvm-svn: 52605
2008-06-21 22:06:54 +00:00
Dan Gohman
a41cf16a8f Simplify some getNode calls.
llvm-svn: 52604
2008-06-21 22:06:07 +00:00
Dan Gohman
4d2c1733d7 canClobberPhysRegDefs shouldn't called without checking hasPhysRegDefs;
check this with an assert.

llvm-svn: 52603
2008-06-21 22:05:24 +00:00
Dan Gohman
e6da01721b Avoid creating a redundant zero APInt.
llvm-svn: 52602
2008-06-21 22:03:12 +00:00
Dan Gohman
a313808e69 Use clear() to zero an existing APInt.
llvm-svn: 52601
2008-06-21 22:02:15 +00:00