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

6906 Commits

Author SHA1 Message Date
Dan Gohman
859ffd353e Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.

llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Owen Anderson
f8addbb0a1 Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Dan Gohman
a07df2e2bf Make this code a little more readable.
llvm-svn: 108968
2010-07-20 23:49:44 +00:00
Dan Gohman
6f009c4a42 Use DebugLocs instead of MDNodes.
llvm-svn: 108967
2010-07-20 23:49:05 +00:00
Dan Gohman
c813346166 Fix a typo.
llvm-svn: 108962
2010-07-20 23:10:36 +00:00
Dan Gohman
66ae369e76 Don't look up the "dbg" metadata kind by name.
llvm-svn: 108961
2010-07-20 23:09:34 +00:00
Dan Gohman
d8e1fd258f Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.

llvm-svn: 108909
2010-07-20 20:09:07 +00:00
Dan Gohman
e36ed050b8 Remember that the induction variable is always a PHINode and
use getIncomingValueForBlock instead of
LoopInfo::getCanonicalInductionVariableIncrement.

llvm-svn: 108865
2010-07-20 17:18:52 +00:00
Owen Anderson
0217b8e1d9 Tweak per Chris' comments.
llvm-svn: 108736
2010-07-19 19:23:32 +00:00
Owen Anderson
8159755faa Reimplement r108639 in InstCombine rather than DAGCombine.
llvm-svn: 108687
2010-07-19 08:09:34 +00:00
Owen Anderson
c8dc055b5e Another attempt at getting the clang self-host to like my instcombine patch.
llvm-svn: 108614
2010-07-17 06:56:35 +00:00
Chris Lattner
663dd0eb36 eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.

llvm-svn: 108553
2010-07-16 20:50:13 +00:00
Dan Gohman
b5593f8fda Reorder the contents of various getAnalysisUsage functions, eliminating
a redundant loopsimplify run from the default -O2 sequence.

llvm-svn: 108539
2010-07-16 17:58:45 +00:00
Owen Anderson
ca2a306a1a Remove the rest of my instcombine changes. Back to the drawing board on this one.
llvm-svn: 108530
2010-07-16 16:39:00 +00:00
Gabor Greif
17c48ecd68 eliminate CallInst::ArgOffset
llvm-svn: 108522
2010-07-16 09:38:02 +00:00
Nick Lewycky
1b4a83430b Arrays and vectors with different numbers of elements are not equivalent.
llvm-svn: 108517
2010-07-16 06:31:12 +00:00
Eric Christopher
5eef314caf Also revert 108422, it's causing some test failures.
Working on testcases for Owen.

llvm-svn: 108494
2010-07-16 01:36:12 +00:00
Dan Gohman
de662ad8b0 Don't merge uses when they are targetting fixup sites with
different widths. In a use with a narrower fixup, formulae
may be wider than the fixup, in which case the high bits
aren't necessarily meaningful, so it isn't safe to reuse
them for uses with wider fixups.

This fixes PR7618, though the testcase is too large for a
reasonable regression test, since it heavily dependes on
hitting LSR's heuristics in a certain way.

llvm-svn: 108455
2010-07-15 20:24:58 +00:00
Dan Gohman
3c5c24ac18 Use dbgs() instead of errs() in a DEBUG.
llvm-svn: 108453
2010-07-15 20:12:42 +00:00
Owen Anderson
cc5ef967da Speculatively revert r108429 to fix the clang self-host.
llvm-svn: 108436
2010-07-15 18:18:57 +00:00
Owen Anderson
565ac2758c Per Chris' suggestion, get rid of the select canonicalization and just add
the corresponding or-icmp-and pattern.  This has the added benefit of doing
the matching earlier, and thus being less susceptible to being confused by
earlier transforms.

llvm-svn: 108429
2010-07-15 17:24:23 +00:00
Owen Anderson
b9f325bab4 Remove unneeded check, and correct style.
llvm-svn: 108427
2010-07-15 16:38:22 +00:00
Dan Gohman
d75ba463e0 Watch out for a constant offset cancelling out a base register, forming
a zero. This situation arrises in Fortran code with induction variables
that start at 1 instead of 0. This fixes PR7651.

llvm-svn: 108424
2010-07-15 15:14:45 +00:00
Owen Anderson
01a2992a91 Reapply r108378, with bugfixes, testcase, and improved comment formatting.
This now passes LIT, nighty test, and llvm-gcc bootstrap on my machine.

llvm-svn: 108422
2010-07-15 15:00:23 +00:00
Nick Lewycky
933c0402bb This is a full sentence.
llvm-svn: 108418
2010-07-15 06:51:22 +00:00
Nick Lewycky
c4e3206edc Disable aliases on all platforms.
llvm-svn: 108417
2010-07-15 06:48:56 +00:00
Chris Lattner
63cfa4b8e0 make various clients of ReplaceAndSimplifyAllUses tolerate
it *changing* the things it replaces, not just causing them
to drop to null.  There is no functionality change yet, but 
this is required for a subsequent patch.

llvm-svn: 108414
2010-07-15 06:06:04 +00:00
Eli Friedman
ded29cd2dc Speculatively revert r108378; may be causing bootstrap failures.
llvm-svn: 108389
2010-07-15 00:33:00 +00:00
Owen Anderson
4656b749f2 Add instcombine transforms to optimize tests of multiple bits of the same value into a single larger comparison.
llvm-svn: 108378
2010-07-14 23:33:51 +00:00
Owen Anderson
5de6c42ebd Extend SimplifyCFG's common-destination folding heuristic to allow a single
"bonus" instruction to be speculatively executed.  Add a heuristic to
ensure we're not tripping up out-of-order execution by checking that this bonus
instruction only uses values that were already guaranteed to be available.

This allows us to eliminate the short circuit in (x&1)&&(x&2).

llvm-svn: 108351
2010-07-14 19:52:16 +00:00
Chris Lattner
38e6ecd9f1 revert r108320, I see the failures now...
llvm-svn: 108322
2010-07-14 06:16:35 +00:00
Chris Lattner
5822d6d579 reapply benjamin's instcombine patch, I don't see anything wrong with it and can't repro any problems with a manual self-host.
llvm-svn: 108320
2010-07-14 05:59:13 +00:00
Eric Christopher
f57bd9c94d Grammar.
llvm-svn: 108252
2010-07-13 18:27:13 +00:00
Duncan Sands
8864383748 Handle the case of a tail recursion in which the tail call is followed
by a return that returns a constant, while elsewhere in the function
another return instruction returns a different constant.  This is a
special case of accumulator recursion, so just generalize the existing
logic a bit.

llvm-svn: 108241
2010-07-13 15:41:41 +00:00
Benjamin Kramer
cf8ad46899 Nope, still breaks the release selfhost bots :(
llvm-svn: 108153
2010-07-12 16:38:48 +00:00
Benjamin Kramer
e391789246 Reapply the "or" half of r108136, which seems to be less problematic.
llvm-svn: 108152
2010-07-12 16:15:48 +00:00
Gabor Greif
9f6b0059e4 cache result of operator*
llvm-svn: 108150
2010-07-12 15:48:26 +00:00
Benjamin Kramer
98c95e7743 Revert r108141 again, sigh.
llvm-svn: 108148
2010-07-12 14:42:04 +00:00
Gabor Greif
04d1ca9e95 cache result of operator*
llvm-svn: 108147
2010-07-12 14:15:58 +00:00
Gabor Greif
b2b6867582 cache result of operator*
llvm-svn: 108146
2010-07-12 14:15:10 +00:00
Gabor Greif
bf2470e6e9 cache result of operator*
llvm-svn: 108145
2010-07-12 14:14:03 +00:00
Gabor Greif
de1c22125f cache result of operator*
llvm-svn: 108144
2010-07-12 14:13:15 +00:00
Gabor Greif
cf2cac8ef4 cache results of operator*
llvm-svn: 108143
2010-07-12 14:12:11 +00:00
Gabor Greif
8159329bfb cache results of operator*
llvm-svn: 108142
2010-07-12 14:10:24 +00:00
Benjamin Kramer
c4f46375d3 Reapply 108136 with an ugly pasto fixed.
llvm-svn: 108141
2010-07-12 13:44:00 +00:00
Benjamin Kramer
e12b88fafe Move optimization to avoid redundant matching.
llvm-svn: 108140
2010-07-12 13:34:22 +00:00
Benjamin Kramer
d9bf737e62 Revert r108136 until I figure out why it broke selfhost.
llvm-svn: 108139
2010-07-12 12:35:49 +00:00
Gabor Greif
8f93852b68 cache dereferenced iterators
llvm-svn: 108138
2010-07-12 12:03:02 +00:00
Gabor Greif
fc666b2d76 recommit r108131 (hich has been backed out in r108135) with a fix
llvm-svn: 108137
2010-07-12 12:02:10 +00:00
Benjamin Kramer
f00a49ceff instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & x) ^ z which is one instruction shorter. (PR6773)
before:
  %and = and i32 %y, %x
  %neg = xor i32 %x, -1
  %and4 = and i32 %z, %neg
  %xor = xor i32 %and4, %and

after:
  %xor1 = xor i32 %z, %y
  %and2 = and i32 %xor1, %x
  %xor = xor i32 %and2, %z

llvm-svn: 108136
2010-07-12 11:54:45 +00:00