Commit Graph

3320 Commits

Author SHA1 Message Date
Victor Hernandez
f2becca90b Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:58:56 +00:00
Victor Hernandez
046e78ce55 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:43:48 +00:00
Devang Patel
5a1033a8ed Do not use expensive sort().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 17:09:00 +00:00
Nick Lewycky
f5a86f45e7 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:57:41 +00:00
Nick Lewycky
6726b6d75a Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:33:48 +00:00
Nick Lewycky
4a134afaef Remove ICmpInst::isSignedPredicate which was a reimplementation
CmpInst::isSigned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 05:20:17 +00:00
Nick Lewycky
44df023d5f Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqual
which is equal to !isTrueWhenEqual for ints but not for floats.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 03:50:03 +00:00
Dan Gohman
dc4a745ffe Make DominanceFrontierBase::print's output prettier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 20:01:11 +00:00
Victor Hernandez
66284e063a Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 04:23:03 +00:00
Victor Hernandez
7b929dad59 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 21:09:37 +00:00
Devang Patel
9d89df1690 Hide MetadataContext implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 19:36:54 +00:00
Devang Patel
f61b2371c8 Fix getMDs() interface such that it does not expose implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 18:55:16 +00:00
Devang Patel
b5681b2293 Using TrackingVH instead of WeakVH or WeakMetadataVH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 18:25:28 +00:00
Devang Patel
d41fc65c56 Sort handler names to ensure deterministic behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 17:40:37 +00:00
Devang Patel
ce6a1c9756 Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 01:01:24 +00:00
Devang Patel
921bdaaa98 Use StringRef to construct MDString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:22:05 +00:00
Devang Patel
49b63a1f2c Remove meaningless const.
Pass StringRef by value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:10:15 +00:00
Devang Patel
49708ad993 Derive metadata hierarchy from Value instead of User.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:57:35 +00:00
Benjamin Kramer
ff233b858a Fix thinko noticed by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:29:32 +00:00
Dale Johannesen
8ba2d5befc Rename msasm to alignstack per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:28:00 +00:00
Benjamin Kramer
e31cd34b8a Remove pointless return; at end of function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:27:54 +00:00
Benjamin Kramer
f8ea2e28bb Simplify code. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 22:55:51 +00:00
Devang Patel
f7ce17e8a8 Use StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 21:57:13 +00:00
Devang Patel
028fa77d56 Do not use SmallVector to store MDNode elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 21:25:09 +00:00
Devang Patel
b5df28a151 Incorporate various suggestions Chris gave during metadata review.
- i < getNumElements()  instead of getNumElements() > i
- Make setParent() private
- Fix use of resizeOperands
- Reset HasMetadata bit after removing all metadata attached to an instruction
- Efficient use of iterators



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 17:33:41 +00:00
Devang Patel
d9723e9a28 Cosmetic changes.
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 22:50:27 +00:00
Owen Anderson
59d5aac0b4 Banish ConstantsLock. It's serving no purpose other than slowing things down
at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 20:11:52 +00:00
Chris Lattner
b2a33b4646 various cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 07:10:59 +00:00
Nick Lewycky
3fc35c594c Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed,
LLVMBuildMalloc was reimplemented but with the bug that it didn't insert the
resulting instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:52:26 +00:00
Chris Lattner
59c4eba416 Teach vm core to more aggressively fold 'trunc' constantexprs,
allowing it to simplify the crazy constantexprs in the testcases
down to something sensible.  This allows -std-compile-opts to
completely "devirtualize" the pointers to member functions in
the testcase from PR5176.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 21:53:27 +00:00
Nick Lewycky
2bb6f6ae7a Emit newlines at the end of instructions too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 19:43:45 +00:00
Daniel Dunbar
4e34a3912a Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 18:11:57 +00:00
Victor Hernandez
a276c603b8 Remove MallocInst from LLVM Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 01:18:07 +00:00
Victor Hernandez
13ad5aaaff Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:00:19 +00:00
Devang Patel
5db2c52270 Add copyMD to copy metadata from one instruction to another instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 17:02:49 +00:00
Duncan Sands
b01bbdcc1a I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 16:11:37 +00:00
Dale Johannesen
4360298d2b Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:46:56 +00:00
Devang Patel
740d0db812 Copy metadata when value is RAUW'd. It is debatable whether this is the right approach for custom metadata data in general. However, right now the only custom data user, "dbg", expects this behavior while FE is constructing llvm IR with debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 17:00:54 +00:00
Nick Lewycky
321333e51e Force memory use markers to have a ConstantInt for the size argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 07:57:33 +00:00
Jeffrey Yasskin
6a9291ad55 Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on the
same Value without breaking things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 17:43:32 +00:00
Chris Lattner
885dffc391 add some more hooks to the C bindings, patch by Kenneth Uildriks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 04:01:02 +00:00
Dan Gohman
8a261e44f7 Add a form of addPreserved which takes a string argument, to allow passes
to declare that they preserve other passes without needing to pull in
additional header file or library dependencies. Convert MachineFunctionPass
and CodeGenLICM to make use of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:00:02 +00:00
Devang Patel
7f93f4d66c Do not assume that the module is set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 16:37:55 +00:00
Duncan Sands
83ed76869e Make getPointerTo return a const PointerType* rather than
an unqualified PointerType* because it seems more correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 07:35:19 +00:00
Duncan Sands
ac53a0b272 Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type.  For example, to get
an i8* use getInt8PtrTy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 15:40:36 +00:00
Chris Lattner
cf0fe8d813 strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison.  Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 05:54:46 +00:00
Nick Lewycky
b13105fbf6 Requires element types in a constant initializer to match the element types of
of the constant. This reverts r6544 and r7428.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 19:30:43 +00:00
Devang Patel
4d7a2061f1 Check for null MDNode element while printing comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:26:51 +00:00
Jeffrey Yasskin
1fb613c43d Assert that ConstantArrays are created with correctly-typed elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:08:08 +00:00
Devang Patel
2d5988d9ba Print tag name for MDNodes that are used to encode debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:16:54 +00:00
Devang Patel
11716d766b Lookup handler name only when assertions are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 22:05:52 +00:00
Devang Patel
74da40a96f Add removeMD().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 20:42:25 +00:00
Devang Patel
58a230a491 Only one custom meadata of each kind can be attached with an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 20:30:57 +00:00
Devang Patel
1d957e4d0d Use assertion instead of early exit to catch malformed custom metadata store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 20:01:19 +00:00
Devang Patel
0475c9170e Parse custom metadata attached with an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 00:01:14 +00:00
Dan Gohman
d0c5a292aa Add C API calls for building FNeg operations. Patch by KS Sreeram!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 21:51:41 +00:00
Devang Patel
e30e678865 s/class Metadata/class MetadataContext/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 21:41:20 +00:00
Devang Patel
a2148402ce Do not use global typedef for MDKindID.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 21:14:55 +00:00
Devang Patel
18f0c263e6 Do not hardcode metadata names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 20:56:00 +00:00
Devang Patel
3168b79c1c Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 18:31:56 +00:00
Dan Gohman
a9245d63f6 Remove temporary debugging hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 00:44:15 +00:00
Dan Gohman
9450b0e1a6 Move the dominator verification code out of special code embedded within
the PassManager code into a regular verifyAnalysis method.

Also, reorganize loop verification. Make the LoopPass infrastructure
call verifyLoop as needed instead of having LoopInfo::verifyAnalysis
check every loop in the function after each looop pass. Add a new
command-line argument, -verify-loop-info, to enable the expensive
full checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 00:27:48 +00:00
Dan Gohman
5c12adaa8b Extend the StartPassTimer and StopPassTimer functions so that the
code that stops the timer doesn't have to search to find the timer
object before it stops the timer. This avoids a lock acquisition
and a few other things done with the timer running.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 00:07:05 +00:00
Dan Gohman
27a8fb8a54 Extract the code for releasing a pass into a separate function, and
tidy it up a little.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 23:38:27 +00:00
Nick Lewycky
c261df9fab Remove the "metadata*" type and simplify the code it complicated. This was only
used to support GlobalVariables storing MDNodes, back when they were derived
from Constant before the introduction of NamedMDNode, but never removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82943 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 23:27:42 +00:00
Nick Lewycky
ae05e7d945 Round out the API for the new optimization flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 21:33:04 +00:00
Dan Gohman
6afea253e0 Micro-optimize DerivedType::dropAllTypeUses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 15:32:21 +00:00
Nick Lewycky
513869453b Remove dead code from this function and optimize. Update its corresponding
LangRef entry too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 07:55:32 +00:00
Nick Lewycky
6776064d19 Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 07:38:41 +00:00
Duncan Sands
3548ea8e90 For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 15:35:35 +00:00
Dan Gohman
a23643d5b7 Rename ConstantFP's getInf to getInfinity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:40:21 +00:00
Dan Gohman
f344f7f008 Add a ConstantFP::getInf utility function for creating infinity ConstantFPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:00:48 +00:00
Victor Hernandez
3e0c99a26f Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:11:52 +00:00
Victor Hernandez
96b930ddc7 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 17:47:49 +00:00
Devang Patel
f9e0a220fc Move parent assertion check before metadata deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 16:19:11 +00:00
Devang Patel
ffa363c94b Delete attached metadata when an instruction is deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 20:33:51 +00:00
Devang Patel
6c6c016b1b Do not leave behind metadata while cloning an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 18:32:25 +00:00
Dan Gohman
cd26ec5f3c Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 01:33:16 +00:00
Victor Hernandez
60cfc03379 No need to verify that malloc's return type is i8*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 18:50:03 +00:00
Daniel Dunbar
460a786b34 Fix commento.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 10:30:34 +00:00
Daniel Dunbar
e5b18362db Add a TrackingVH value handle.
This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type.

For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class.

The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 02:02:33 +00:00
Chris Lattner
850c9178dc Fix PR5023: The instruction form of DominatorTree::dominates did not
take into consideration that the result of an invoke is only valid in
the normal dest, not the unwind dest.  This caused 'PHINode::hasConstantValue'
to return true in an invalid situation, causing mem2reg to delete a phi that
was actually needed.  This caused a crash building 483.xalancbmk.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 22:39:35 +00:00
Chris Lattner
75c7c995b7 move DominatorTree::dominates for instructions out of line,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 22:30:50 +00:00
Chris Lattner
0e657faee5 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82489 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 22:27:34 +00:00
Nuno Lopes
fa9a3027bc initialize SymbolsCanStartWithDigit to false by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 14:11:56 +00:00
Nick Lewycky
149cbc2a24 Peer through zext and sext to eliminate them when it is safe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:31:25 +00:00
Nick Lewycky
85958b059d Fold 'icmp eq (icmp), true' into an xor(icmp).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 07:21:39 +00:00
Nick Lewycky
b13efdafec Correct the comment; this applies to fcmp too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:27:35 +00:00
Nick Lewycky
8577e27dd3 Remove tab, again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:26:34 +00:00
Nick Lewycky
3105ebfaf7 Teach the constant folder how to not a cmpinst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:24:51 +00:00
Nick Lewycky
55a722bf6a Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
the hopes that the two bitcasts will merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 05:48:50 +00:00
Nick Lewycky
8de003663d Remove tabs I added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 05:47:45 +00:00
Nick Lewycky
3892baac42 Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 04:27:06 +00:00
Daniel Dunbar
ce99a6e49e Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 04:03:34 +00:00
Nick Lewycky
d43737bd09 Remove dead store by taking a guess at what Chris meant. I wasn't able to
design a testcase that would tickle this behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 03:48:46 +00:00
Daniel Dunbar
a279bc3da5 Tabs -> spaces, and remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 02:20:51 +00:00
Nick Lewycky
a80e9598ca Delete dead code. sext and zext can not turn integers into pointers. Further,
the optimization described in the comment is only valid with target data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 02:11:47 +00:00
Nick Lewycky
33c06adcf1 Value* were never meant to be const. Removing constness from the constant
folder removes a lot of const_casting and requires no changes to clang or
llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 01:35:59 +00:00
Nick Lewycky
f4d1882743 Teach the constant folder how to handle a few simple i1 cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 00:04:02 +00:00
Devang Patel
e8e0213cc3 Write and read metadata attachments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:26:43 +00:00
Victor Hernandez
88d9839d07 Update malloc call creation code (AllocType is now the element type of the malloc, not the resulting type).
In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants.

Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array.

Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type.

Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls.

Add verification for malloc calls.

Reviewed by Dan Gohman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:20:02 +00:00
Anton Korobeynikov
c6f729ed55 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 16:57:42 +00:00
Benjamin Kramer
d8c8e01fe8 Initialize HasMetadata to zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 14:51:57 +00:00
Devang Patel
43215788d5 Print debug info attached with an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 20:21:17 +00:00
Devang Patel
937b1e92a9 Add llvm::Metadata to manage metadata used in a context.
This interface will be used to attach metadata with an instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 18:09:00 +00:00
Dan Gohman
f672ab89ec Fix an accidental inversion of the inbounds flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 16:00:30 +00:00
Dan Gohman
e3394d4a49 When a constant's type is refined, update the constant in place
instead of cloning and RAUWing it.

 - Make AbstractTypeUser a friend of Value so that it can offer
   its subclasses a way to update a Value's type in place. This
   is better than a universally visible setType method on Value,
   and it's sufficient for the immediate need.

 - Eliminate the constant "convert" functions. This eliminates a
   lot of logic duplication, and fixes a complicated bug where a
   constant can't actually be cloned during the type refinement
   process because some of the types that its folder needs are
   half-destroyed, being in the middle of refinement themselves.

 - Move the getValType functions from being static overloaded
   functions in Constants.cpp to be members of class template
   specializations in ConstantsContext.h. This means that the
   code ends up getting instantiated twice, however it also
   makes it possible to eliminate all "convert" functions, so
   it's not a big net code size increase. And if desired, the
   duplicate instantiations could be eliminated with some
   reorganization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 15:58:07 +00:00
Nick Lewycky
1fbb13e4fa Forbid arrays of function-type and structures with function-typed fields.
While I'm there, change code that does:
  SomeTy == Type::getFooType(Context)
into:
  SomeTy->getTypeID() == FooTyID
to decrease the amount of useless type creation which may involve locking, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 06:28:26 +00:00
Chris Lattner
dd4238e04d fix PR4963: folding insertvalue would sometimes turn a packed struct into
an unpacked one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 06:28:12 +00:00
Chris Lattner
9554c61328 make -debug-pass=Executions show information about what call graph nodes
are in the SCC for each execution of a CGSCC pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 05:03:04 +00:00
Chris Lattner
745c9be986 add some missing quotes in debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 04:45:26 +00:00
Nick Lewycky
af7263d51e Fix a pair of comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81750 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 02:25:34 +00:00
Nick Lewycky
5df6ffd948 Fifth time's a charm! Remove ourselves as abstract type listeners once we've
been told that the type is no longer abstract.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 02:25:19 +00:00
Nick Lewycky
adc3142fdd Don't leak! Always remove oneself as a listener after adding oneself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 00:36:52 +00:00
Nick Lewycky
bc6836bbe3 Actually remove old types from the set.
Also break the type verification stuff into its own TypeSet to keep the
Verifier pass from becoming an AbstractTypeUser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 23:45:39 +00:00
Nick Lewycky
6735b1c5c4 Storing a set of PATypeHolders is a bad idea because their sort order will
change as types are refined. Remove abstract types from CheckedTypes when they
we're informed that they have been refined. The only way types get refined in
the verifier is when later function passes start optimizing. Fixes PR4970.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 21:07:59 +00:00
Chris Lattner
e19f978323 Make the MC symbol printer and llvm::Mangler exactly agree on mangling
for systems that don't support quoting (PR4966).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:04:46 +00:00
Dan Gohman
4acac62e8d Preserve the inbounds flag, so that the constant folder doesn't
recompute it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 22:02:17 +00:00
Dan Gohman
349a2ebbb3 Fix the build when DEBUG_SYMBOL_TABLE is set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 21:56:48 +00:00
Daniel Dunbar
37acc1aac7 Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 22:07:31 +00:00
Chris Lattner
13202deca6 reject attempts to take the address of an intrinsic, PR4949.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 17:05:29 +00:00
Chris Lattner
ceddb2b856 fix prefix ordering, it's L_foo not _Lfoo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:51:29 +00:00
Chris Lattner
5b7dfeebff add a new Mangler::getNameWithPrefix API which returns the
(uniqued if unnamed) global variable name with the prefix that
it is supposed to get.  It doesn't do "mangling" in the sense of
adding quotes and hacking on bad characters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:40:42 +00:00
Dan Gohman
c24edfaee2 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:05:10 +00:00
Dan Gohman
3bfbc4587a Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:04:14 +00:00
Dan Gohman
e6992f728a Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:37:55 +00:00
Devang Patel
fa82441868 Fix whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:36:12 +00:00
Benjamin Kramer
b84c5ae3d4 Add some braces to make newer GCCs happy and update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 11:31:39 +00:00
Evan Cheng
fabcb9127f Add malloc call utility functions. Patch by Victor Hernandez.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 04:36:43 +00:00
Devang Patel
88cfd964a3 Take lock before removing a node from MDNodeSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 17:44:26 +00:00
Devang Patel
740fce3020 Enable MDNode uniquing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 17:30:04 +00:00
Devang Patel
9c0aa85337 Gracefully destroy MDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 17:07:07 +00:00
Devang Patel
41fc6277f0 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 18:14:36 +00:00
Nick Lewycky
8f5075b966 Hoist out the test+insert to CheckedTypes. This doesn't seem to affect
performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:46:15 +00:00
Nick Lewycky
4b6af8aa5b Simplify from my last change. Assert1 is a macro that makes its caller return,
so "Assert1(isa<>); cast<>" is a valid idiom.

Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like
the comment said.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 02:02:39 +00:00
Nick Lewycky
49072473ba Verify types. Invalid types can be constructed when assertions are off.
Make the verifier more robust by avoiding unprotected cast<> calls. Notably,
Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 01:23:52 +00:00
Dan Gohman
f8dbee7cea Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:54:19 +00:00
Nick Lewycky
a9b7738d13 Express this in the canonical way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 21:50:24 +00:00
Nick Lewycky
29ef6599ee Homogenize whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 20:44:51 +00:00
Daniel Dunbar
d34b0b1cda Disable MDNode uniquing.
- Hopefully this unbreaks some llvm-gcc bootstraps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 04:05:49 +00:00
Duncan Sands
59bf4fcc06 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:55:57 +00:00
Duncan Sands
b7c5bdf843 Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:33:48 +00:00
Daniel Dunbar
92a97a9166 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:11:24 +00:00
Devang Patel
68f195cc50 While replacing an MDNode elment, properly update MDNode's operand list.
MDNode's operand list does not include all elements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 21:32:05 +00:00
Dan Gohman
859fff476d Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:08:11 +00:00
Dan Gohman
6e7ad95868 Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:34:49 +00:00
Dan Gohman
e56a94ef91 Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:17:40 +00:00
Devang Patel
73b1ee857b Use WeakVH to hold dead mdnodes. Check use_empty() before deleting a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:03:47 +00:00
Dan Gohman
bccfc24c4e Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:34:35 +00:00
Gabor Greif
03a5f139fb back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:02:59 +00:00