1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

305 Commits

Author SHA1 Message Date
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Chris Lattner
c4ab50bd33 move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.

llvm-svn: 135669
2011-07-21 06:21:31 +00:00
Jay Foad
ae5894c5cc Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.
llvm-svn: 135477
2011-07-19 13:32:40 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Eli Friedman
58beee1262 PR7952: Make isa<> use the same logic as cast<>, so that they both work
consistently.

llvm-svn: 131803
2011-05-21 19:13:10 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Nick Lewycky
5de10fb201 SCCP doesn't actually preserve the CFG. It will delete and insert terminator
instructions.

llvm-svn: 123973
2011-01-21 08:38:09 +00:00
Chris Lattner
f3b214e298 simplify a little
llvm-svn: 123573
2011-01-16 07:11:21 +00:00
Dale Johannesen
1ab2213b84 Avoid exponential growth of a table. It feels like
there should be a better way to do this.  PR 8679.

llvm-svn: 120457
2010-11-30 20:23:21 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Chris Lattner
d20a060467 remove some dead code.
llvm-svn: 111344
2010-08-18 02:41:56 +00:00
Chris Lattner
fd40059e71 fix PR7876: If ipsccp decides that a function's address is taken
before it rewrites the code, we need to use that in the post-rewrite pass.

llvm-svn: 110962
2010-08-12 22:25:23 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Gabor Greif
0899f01287 simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree
llvm-svn: 109687
2010-07-28 22:50:26 +00:00
Owen Anderson
f8addbb0a1 Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Chris Lattner
9065710fcf fix PR6940: sitofp(undef) folds to 0.0, not undef.
llvm-svn: 102358
2010-04-26 18:21:23 +00:00
Chris Lattner
08fed5e338 fix a SCCP miscompilation that could happen when a
forced constant is changed to a constant, we would end
up adding the instruction to the wrong worklist, 
preventing it from being properly revisited.  This fixes
rdar://7832370

llvm-svn: 100837
2010-04-09 01:14:31 +00:00
Chris Lattner
e25e981494 fix a really nasty bug that Evan was tracking in SCCP. When resolving
undefs in branches/switches, we have two cases: a branch on a literal
undef or a branch on a symbolic value which is undef.  If we have a
literal undef, the code was correct: forcing it to a constant is the
right thing to do.

If we have a branch on a symbolic value that is undef, we should force
the symbolic value to a constant, which then makes the successor block
live.  Forcing the condition of the branch to being a constant isn't 
safe if later paths become live and the value becomes overdefined.  This
is the case that 'forcedconstant' is designed to handle, so just use it.

This fixes rdar://7765019 but there is no good testcase for this, the
one I have is too insane to be useful in the future.

llvm-svn: 100478
2010-04-05 22:14:48 +00:00
Gabor Greif
0ed92c6e98 Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.

llvm-svn: 100100
2010-04-01 08:21:08 +00:00
Gabor Greif
df5013e4d8 rename use_const_iterator to const_use_iterator for consistency's sake
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Gabor Greif
624a31f2eb Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.

llvm-svn: 99399
2010-03-24 13:21:49 +00:00
Gabor Greif
93c52b215c increase const goodness and remove pointless getUser() calls
llvm-svn: 99395
2010-03-24 10:29:52 +00:00
Chris Lattner
ca018ea20b fix grammaro's pointed out by daniel
llvm-svn: 97313
2010-02-27 07:50:40 +00:00
Chris Lattner
93fd3ddf24 fix PR6414, a nondeterminism issue in IPSCCP which was because
of a subtle interation in a loop operating in densemap order.

llvm-svn: 97288
2010-02-27 00:07:42 +00:00
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
David Greene
02e79531be Change errs() to dbgs().
llvm-svn: 92612
2010-01-05 01:27:15 +00:00
Dan Gohman
0ef3e7cf76 Fix a use of an invalidated iterator in the case where there are multiple
adjacent uses of a dead basic block from the same user. This fixes PR5596.

llvm-svn: 89658
2009-11-23 16:13:39 +00:00
Dan Gohman
94cca19d9d Fix IPSCCP's code for deleting dead blocks to tolerate outstanding
blockaddress users. This fixes PR5569.

llvm-svn: 89483
2009-11-20 20:19:14 +00:00
Chris Lattner
a163be92fc fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter!

llvm-svn: 86726
2009-11-10 22:02:09 +00:00
Benjamin Kramer
f10e3edefb Do map insert+find in one step. TODO -= 2.
llvm-svn: 86133
2009-11-05 14:33:27 +00:00
Chris Lattner
4864198071 Fix an iterator invalidation bug that happens when a hashtable
resizes in IPSCCP.  This fixes PR5394.

llvm-svn: 86036
2009-11-04 18:57:42 +00:00
Chris Lattner
b634c6cdb5 reimplement multiple return value handling in IPSCCP, making it
more aggressive an correct.  This survives building llvm in 64-bit
mode with optimizations and the built llvm passes make check.

llvm-svn: 85973
2009-11-03 23:40:48 +00:00
Chris Lattner
10c341e8fa finish half thunk thought
llvm-svn: 85937
2009-11-03 20:52:57 +00:00
Chris Lattner
2aa5962af6 fix an IPSCCP bug I introduced when I changed IPSCCP to start working on
functions that don't have local linkage.  Basically, we need to be more
careful about propagating argument information to functions whose results
we aren't tracking.  This fixes a miscompilation of 
LLVMCConfigurationEmitter.cpp when built with an llvm-gcc that has ipsccp
enabled.

llvm-svn: 85923
2009-11-03 19:24:51 +00:00
Chris Lattner
bfe755788f fix a subtle bug I introduced when refactoring SCCP. Testcase
to follow.

llvm-svn: 85903
2009-11-03 16:50:11 +00:00
Chris Lattner
b1dfdadabd turn IPSCCP back on now that the iterator invalidation bug is fixed.
llvm-svn: 85858
2009-11-03 03:42:51 +00:00
Chris Lattner
00c9eb665d fix a nasty iterator invalidation bug from my conversion from
std::map to DenseMap, exposed on release llvm-gcc bootstrap.

llvm-svn: 85840
2009-11-02 23:25:39 +00:00
Chris Lattner
6f515d4ba8 revert r8579[56], which are causing unhappiness in buildbot land.
llvm-svn: 85818
2009-11-02 19:31:10 +00:00
Chris Lattner
a1776913ab disable IPSCCP support for multiple return values, it is buggy, so just
disable it until I can fix it.

llvm-svn: 85810
2009-11-02 18:22:51 +00:00
Chris Lattner
f1afb57935 improve IPSCCP to be able to propagate the result of "!mayBeOverridden"
function to calls of that function, regardless of whether it has local
linkage or has its address taken.  Not escaping should only affect 
whether we make an aggressive assumption about the arguments to a 
function, not whether we can track the result of it.

llvm-svn: 85795
2009-11-02 07:33:59 +00:00
Chris Lattner
c9279a9b4d don't mark the arguments of prototype overdefined, they will never be queried.
llvm-svn: 85793
2009-11-02 06:34:04 +00:00
Chris Lattner
9c7e443b07 restore some code I removed in r85788, refactor it into
a shared place instead of duplicating it 4 times.

llvm-svn: 85792
2009-11-02 06:28:16 +00:00
Chris Lattner
23f5603692 remove some confused code that dates from when we had
"multiple return values" but not "first class aggregates"

llvm-svn: 85791
2009-11-02 06:17:06 +00:00
Chris Lattner
c670f866ce avoid redundant lookups in BBExecutable, and make it a SmallPtrSet.
llvm-svn: 85790
2009-11-02 06:11:23 +00:00
Chris Lattner
16b825e51f Use the libanalysis 'ConstantFoldLoadFromConstPtr' function
instead of reinventing SCCP-specific logic.  This gives us
new powers.

llvm-svn: 85789
2009-11-02 06:06:14 +00:00
Chris Lattner
32acebedf7 switch the main 'ValueState' map from being an std::map to being
a DenseMap.  Doing this required being aware of subtle iterator
invalidation issues, but it provides a big speedup.  In a 
release-asserts build, this sped up optimizing 403.gcc from
1.34s -> 0.79s (IPSCCP) and 1.11s -> 0.44s (SCCP).

This commit also conflates in a bunch of general cleanups, sorry.

llvm-svn: 85788
2009-11-02 05:55:40 +00:00
Chris Lattner
7e74831e52 only IPSCCP incoming arguments if the function is executable, this fixes
an assertion on the buildbot.

llvm-svn: 85784
2009-11-02 03:25:55 +00:00