Commit Graph

3650 Commits

Author SHA1 Message Date
Dan Gohman
1ec7f5feb3 Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:53:53 +00:00
Owen Anderson
9650983b9a Move the smarts of AnalysisGroup registration into PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:52:45 +00:00
Dan Gohman
3bdfbf5d56 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:55:01 +00:00
Owen Anderson
539673579e Move the handling of PassRegistrationListener's to PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:41:56 +00:00
Dan Gohman
4f1be4abba Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 22:25:04 +00:00
Dan Gohman
19538d1e9f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:42:28 +00:00
Owen Anderson
aac07eaeef Move more functionality from Pass.cpp to PassRegistry.cpp. This global will go away eventually, but for now we still need it around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:22:24 +00:00
Dan Gohman
a09e67af33 Remove setDbgMetadata and getDbgMetadata; their users have been
replaced with setDebugLoc and getDebugLoc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 20:18:21 +00:00
Owen Anderson
ee9886ed3d I just fail with SVN today.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 19:23:55 +00:00
Owen Anderson
39b890dfa2 Convert the internal PassRegistrar class into a new, external PassRegistry class. No intended functionality change at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 18:39:06 +00:00
Owen Anderson
2dcacabc71 Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:55:05 +00:00
Owen Anderson
8be3291f59 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 08:26:15 +00:00
Owen Anderson
9e081004da Reapply r108794, a fix for the failing test from last time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 06:52:42 +00:00
Daniel Dunbar
e8a469cdb4 Revert r108794, "Separate PassInfo into two classes: a constructor-free
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 03:06:07 +00:00
Owen Anderson
8ba15cb709 Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 01:19:58 +00:00
Owen Anderson
7ee5d35493 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 21:44:48 +00:00
Duncan Sands
837a0c3b05 Expose BasicBlock::moveBefore and moveAfter in C API, patch
by Benjamin Saunders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 15:31:07 +00:00
Gabor Greif
b68f7aea33 precompute 20 tags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 14:48:15 +00:00
Gabor Greif
aa7e8b27ad fullStopTag cannot happen here, it is handled above
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 20:52:46 +00:00
Chris Lattner
93604b6de2 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:13:52 +00:00
Chris Lattner
40f9be514b tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 21:20:46 +00:00
Chris Lattner
49669e6d3a eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 20:50:13 +00:00
Gabor Greif
345ce549a9 get the first few tags from a precomputed table (count can be increased if desired)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 20:35:19 +00:00
Gabor Greif
a6aac4c5bc eliminate CallInst::ArgOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 09:38:02 +00:00
Tobias Grosser
74c740052a LoopSimplify does not update domfrontier correctly.
This fixes PR7649.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 05:59:45 +00:00
Tobias Grosser
9a7b37b8a3 Add dump() to DominanceFrontier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 05:59:39 +00:00
Benjamin Kramer
38e59891ee Don't pass StringRef by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 22:38:02 +00:00
Dan Gohman
79b78a43ec Just use getParent() instead of getModuleFromVal when the value is a Function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 21:12:44 +00:00
Dan Gohman
40cf12fe77 Rename WriteConstantInt to WriteConstantInternal, to avoid confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 20:57:55 +00:00
Dan Gohman
ac80975ea4 Add support for empty metadata nodes: !{}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:33:27 +00:00
Gabor Greif
63d024fc9a 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 15:31:36 +00:00
Gabor Greif
a8b9df7bd9 cache dereferenced iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 10:36:48 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Chris Lattner
dfd3626b47 fix PR7311 by avoiding breaking casts when a bitcast from scalar->vector
is involved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 01:19:22 +00:00
Chris Lattner
5a30a8574c make the prototypes for CreateMalloc and CreateFree more consistent. Patch
by Hans Vandierendonck from PR7605


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 00:57:28 +00:00
Nick Lewycky
8e82e3bf59 If it's safe to speculatively execute load(alloca) the it's safe to execute
load(gep(alloca)) where the gep is all-zeros. There's more we could do here but
this is a common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 20:36:29 +00:00
Chris Lattner
b4a9631e55 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 19:42:53 +00:00
Chris Lattner
8fff12605e use PrintEscapedString to handle attribute section with escapes in it,
PR7399.  The asm parser already handles this.  This is of dubious 
utility (see the PR) but the asmprinter was clearly broken here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 23:16:37 +00:00
Devang Patel
6db2389d69 Add fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 21:05:17 +00:00
Dan Gohman
108e3707fa IndirectBr is not safe to speculatively execute (!)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 00:35:34 +00:00
Bill Wendling
5e721d7682 Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 21:55:59 +00:00
Gabor Greif
fa680ea1eb reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 10:41:37 +00:00
Bill Wendling
07d3177117 Revert r107205 and r107207.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 22:34:52 +00:00
Bill Wendling
207855cff9 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 21:24:00 +00:00
Gabor Greif
cfbb7d4329 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:17:26 +00:00
Gabor Greif
eff566d19a encode operand initializations (at fixed index)
in terms of Op<> and ArgOffset. This works for
values of {0, 1} for ArgOffset.
Please note that ArgOffset will become 0 soon and
will go away eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:41:38 +00:00
Dan Gohman
0dd3549edc Constant fold x == undef to undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 21:30:07 +00:00
Dan Gohman
50f424c3d0 Fix Value::stripPointerCasts and BasicAA to avoid trouble on
code in unreachable blocks, which have have use-def cycles.
This fixes PR7514.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 21:16:52 +00:00
Gabor Greif
b37a64a726 use ArgOperand accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 13:56:57 +00:00
Gabor Greif
7bbdf0c848 use ArgOperand accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 13:09:06 +00:00