Commit Graph

3559 Commits

Author SHA1 Message Date
Dan Gohman 390914cbe8 Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.

llvm-svn: 109653
2010-07-28 20:56:48 +00:00
Dan Gohman a7e5a24093 Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.

llvm-svn: 109643
2010-07-28 20:12:04 +00:00
Duncan Sands fd5c8329cf After updating value handles for RAUW, check that no weak or tracking handles
are still on the list.  This might happen if a CallbackVH created some new value
handles for the old value when doing RAUW.  Barf if it occurs, since it is almost
certainly a mistake.

llvm-svn: 109495
2010-07-27 06:53:14 +00:00
Dan Gohman accaca5604 Fix (at least) quadratic worst-case complexity in DominanceFrontier::splitBlock:
don't visit all blocks in the function, and don't iterate over the split blocks'
predecessor lists for each block visited.

Also, remove the special-case test for the entry block. Splitting the entry
block isn't common enough to make this worthwhile.

This fixes a major compile-time bottleneck which is exposed now that
LoopSimplify isn't being redundantly run both before and after
DominanceFrontier.

llvm-svn: 109408
2010-07-26 17:55:15 +00:00
Dan Gohman 30005444fe Avoid copying and recopying a std::set.
llvm-svn: 109405
2010-07-26 17:45:33 +00:00
Dan Gohman 2307c4bb76 Exit a search loop when the search goal is found.
llvm-svn: 109404
2010-07-26 17:41:45 +00:00
Dan Gohman 45af0ad182 Fix formatting.
llvm-svn: 109403
2010-07-26 17:39:33 +00:00
Benjamin Kramer 5aaf677a37 Reduce string trashing.
llvm-svn: 109386
2010-07-25 23:18:32 +00:00
Eli Friedman 5f6112450f PR7704: A function is not allowed to return a function; make sure to enforce
this consistently.

llvm-svn: 109360
2010-07-24 22:58:04 +00:00
Duncan Sands 3bc93c2f2f Clarify that if a new value handle is added while dropping value handles
hanging off a value, then the dropping code will intentionally not drop
it too (since this is almost certainly a bug).

llvm-svn: 109337
2010-07-24 12:09:22 +00:00
Gabor Greif 3e44ea1917 undo 80 column trespassing I caused
llvm-svn: 109092
2010-07-22 10:37:47 +00:00
Dan Gohman 2637cc1a38 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 a57b97e7e7 Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Dan Gohman 477498f3d7 NamedMDNode is never an operand.
llvm-svn: 109031
2010-07-21 20:25:43 +00:00
Dan Gohman 093cb79d4b Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).

llvm-svn: 109028
2010-07-21 18:54:18 +00:00
Dan Gohman 846b9e15db Use TrackingVH instead of WeakVH for NamedMDNode's operands, since nodes
referenced by NamedMDNodes shouldn't be deleted.

llvm-svn: 109021
2010-07-21 18:01:42 +00:00
Dan Gohman 2b68cc68ed Tidy.
llvm-svn: 109020
2010-07-21 17:53:53 +00:00
Owen Anderson 845b14ef66 Move the smarts of AnalysisGroup registration into PassRegistry.
llvm-svn: 109019
2010-07-21 17:52:45 +00:00
Dan Gohman a2489d1bb6 Give MDNode printing has access to the current Module in more
cases. This will be needed when function-local metadata can
appear in places that aren't intrinsic function arguments.

llvm-svn: 108971
2010-07-20 23:55:01 +00:00
Owen Anderson 7fc9fe7553 Move the handling of PassRegistrationListener's to PassRegistry.
llvm-svn: 108966
2010-07-20 23:41:56 +00:00
Dan Gohman 48a995f7e9 Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.

llvm-svn: 108948
2010-07-20 22:25:04 +00:00
Dan Gohman 43aa8f03c1 Add support for remapping metadata kind IDs when reading in a
bitcode file, so that two bitcode files where the same metadata kind
name happens to have been assigned a different ID can still be
linked together.

Eliminate the restriction that metadata kind IDs can't be 0.

Change MD_dbg from 1 to 0, because we can now, and because it's
less mysterious that way.

llvm-svn: 108939
2010-07-20 21:42:28 +00:00
Owen Anderson 4154061b92 Move more functionality from Pass.cpp to PassRegistry.cpp. This global will go away eventually, but for now we still need it around.
llvm-svn: 108932
2010-07-20 21:22:24 +00:00
Dan Gohman 47a0f0d56f Remove setDbgMetadata and getDbgMetadata; their users have been
replaced with setDebugLoc and getDebugLoc.

llvm-svn: 108914
2010-07-20 20:18:21 +00:00
Owen Anderson 660466ed42 I just fail with SVN today.
llvm-svn: 108888
2010-07-20 19:23:55 +00:00
Owen Anderson 1e8ae64f83 Convert the internal PassRegistrar class into a new, external PassRegistry class. No intended functionality change at this point.
llvm-svn: 108877
2010-07-20 18:39:06 +00:00
Owen Anderson 3183ef1120 Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
llvm-svn: 108856
2010-07-20 16:55:05 +00:00
Owen Anderson 81781220d2 Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.

llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson 8dc129325f Reapply r108794, a fix for the failing test from last time.
llvm-svn: 108813
2010-07-20 06:52:42 +00:00
Daniel Dunbar 4a35d6f8cd Revert r108794, "Separate PassInfo into two classes: a constructor-free
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.

llvm-svn: 108805
2010-07-20 03:06:07 +00:00
Owen Anderson e7c5fe586a Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
llvm-svn: 108794
2010-07-20 01:19:58 +00:00
Owen Anderson 0edf6a1131 Change the implemented interfaces list on PassInfo from a std::vector to a manually implemented
linked list.  This is a little slower and involves more malloc'ing, but these lists are
typically short, and it allows PassInfo to be entirely constant initializable.

llvm-svn: 108755
2010-07-19 21:44:48 +00:00
Duncan Sands b1d61aab06 Expose BasicBlock::moveBefore and moveAfter in C API, patch
by Benjamin Saunders.

llvm-svn: 108699
2010-07-19 15:31:07 +00:00
Gabor Greif 39c06b3b23 precompute 20 tags
llvm-svn: 108695
2010-07-19 14:48:15 +00:00
Gabor Greif 2960987ddb fullStopTag cannot happen here, it is handled above
llvm-svn: 108631
2010-07-17 20:52:46 +00:00
Chris Lattner 718da70ca2 Fix PR7658, a problem where type refinement can trigger
constant replacement which was botching its handling of
types.  Use of getType() instead of getRawType() was causing
the type map in constant folding to be updated wrong.

llvm-svn: 108610
2010-07-17 06:13:52 +00:00
Chris Lattner c9c22862d4 tidy up
llvm-svn: 108560
2010-07-16 21:20:46 +00:00
Chris Lattner 27e997a168 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
Gabor Greif fee4dafbd0 get the first few tags from a precomputed table (count can be increased if desired)
llvm-svn: 108549
2010-07-16 20:35:19 +00:00
Gabor Greif 6d673953e3 eliminate CallInst::ArgOffset
llvm-svn: 108522
2010-07-16 09:38:02 +00:00
Tobias Grosser 3d84c9c793 LoopSimplify does not update domfrontier correctly.
This fixes PR7649.

llvm-svn: 108513
2010-07-16 05:59:45 +00:00
Tobias Grosser bd7c9f701b Add dump() to DominanceFrontier
llvm-svn: 108512
2010-07-16 05:59:39 +00:00
Benjamin Kramer 92d8998348 Don't pass StringRef by reference.
llvm-svn: 108366
2010-07-14 22:38:02 +00:00
Dan Gohman 1513217e27 Just use getParent() instead of getModuleFromVal when the value is a Function.
llvm-svn: 108358
2010-07-14 21:12:44 +00:00
Dan Gohman efb8dbb3f1 Rename WriteConstantInt to WriteConstantInternal, to avoid confusion.
llvm-svn: 108357
2010-07-14 20:57:55 +00:00
Dan Gohman 1e0213a758 Add support for empty metadata nodes: !{}.
llvm-svn: 108259
2010-07-13 19:33:27 +00:00
Gabor Greif 03e7e68caa rotate CallInst operands
with this commit the callee moves to the end of
the operand array (from the start) and the call
arguments now start at index 0 (formerly 1)

this ordering is now consistent with InvokeInst

this commit only flips the switch,
functionally it is equivalent to
r101465

I intend to commit several cleanups after a few
days of soak period

llvm-svn: 108240
2010-07-13 15:31:36 +00:00
Gabor Greif 2a464d7308 cache dereferenced iterators
llvm-svn: 108131
2010-07-12 10:36:48 +00:00
Duncan Sands 41b4a6b36a Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Chris Lattner 25eea4db66 fix PR7311 by avoiding breaking casts when a bitcast from scalar->vector
is involved.

llvm-svn: 108117
2010-07-12 01:19:22 +00:00