Chris Lattner
56e327711b
fix a buggy assertion, CreateIntegerCast should allow
...
integer vectors as well as just integers.
llvm-svn: 93126
2010-01-10 20:21:42 +00:00
Mikhail Glushenkov
e141fc9e1c
Suppress a warning on gcc 4.4.
...
warning: suggest parentheses around ‘&&’ within ‘||’.
llvm-svn: 93121
2010-01-10 18:48:49 +00:00
Victor Hernandez
f4272b50d6
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
...
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Chris Lattner
953394de82
"In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
...
Patch by James Y Knight!
llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Devang Patel
bd58ff3f60
Delete NamedMDSymTable while destrucing Module.
...
Disable copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.
llvm-svn: 93041
2010-01-09 01:44:59 +00:00
Devang Patel
ea208bf99c
Derive NamedMDNode from Value.
...
llvm-svn: 93032
2010-01-09 00:30:14 +00:00
Devang Patel
10ee76f7f4
Use separate namespace for named metadata.
...
llvm-svn: 92931
2010-01-07 19:39:36 +00:00
Devang Patel
311b5584e5
Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1 , null}
...
llvm-svn: 92783
2010-01-05 21:47:32 +00:00
Victor Hernandez
173518e4ae
Fix comment for CheckDebugInfoIntrinsics
...
llvm-svn: 92774
2010-01-05 21:13:46 +00:00
Benjamin Kramer
0ba7479f2c
Move remaining stuff to the isInteger predicate.
...
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Devang Patel
ab66612f1b
NamedMDNode is a collection MDNodes.
...
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Benjamin Kramer
c233521d45
Convert a ton of simple integer type equality tests to the new predicate.
...
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Benjamin Kramer
6a11532b00
Add a new predicate for integer type equality tests.
...
llvm-svn: 92759
2010-01-05 20:04:48 +00:00
Benjamin Kramer
e90a3c66c4
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
...
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
David Greene
a2eb2bde9e
Fix a build error and change errs() to dbgs().
...
llvm-svn: 92669
2010-01-05 01:34:26 +00:00
David Greene
2f3bd270a0
Change errs() to dbgs().
...
llvm-svn: 92665
2010-01-05 01:30:18 +00:00
David Greene
1ee15299b7
Change errs() to dbgs().
...
llvm-svn: 92664
2010-01-05 01:30:14 +00:00
David Greene
da24eb426d
Change errs() to dbgs().
...
llvm-svn: 92663
2010-01-05 01:30:09 +00:00
David Greene
38e8cf6313
Change errs() to dbgs().
...
llvm-svn: 92662
2010-01-05 01:30:06 +00:00
David Greene
b4caa095f9
Change errs() to dbgs().
...
llvm-svn: 92661
2010-01-05 01:30:04 +00:00
David Greene
3a9e6e8827
Change errs() to dbgs().
...
llvm-svn: 92660
2010-01-05 01:30:02 +00:00
David Greene
36abd30d2e
Change errs() to dbgs().
...
llvm-svn: 92659
2010-01-05 01:30:00 +00:00
David Greene
f8d868e805
Change errs() to dbgs().
...
llvm-svn: 92658
2010-01-05 01:29:58 +00:00
David Greene
446bde822e
Change errs() to dbgs().
...
llvm-svn: 92657
2010-01-05 01:29:55 +00:00
David Greene
6ad48aba1c
Change errs() to dbgs().
...
llvm-svn: 92656
2010-01-05 01:29:39 +00:00
David Greene
5008e561e3
Change errs() to dbgs().
...
llvm-svn: 92652
2010-01-05 01:29:26 +00:00
David Greene
8637fd7d59
Change errs() to dbgs().
...
llvm-svn: 92650
2010-01-05 01:29:19 +00:00
David Greene
053abe1bdb
Change errs() to dbgs().
...
llvm-svn: 92649
2010-01-05 01:29:14 +00:00
Devang Patel
3b08c33f33
Remove dead debug info intrinsics.
...
Intrinsic::dbg_stoppoint
Intrinsic::dbg_region_start
Intrinsic::dbg_region_end
Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.
llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Dan Gohman
4a8e4ee52a
Add a comment.
...
llvm-svn: 92492
2010-01-04 18:38:39 +00:00
Chris Lattner
80802043f4
it isn't safe to speculative load from a malloc, it might have
...
returned null, and may not have been big enough in any case.
Thanks to Jay Foad for pointing this out!
llvm-svn: 92452
2010-01-03 18:14:24 +00:00
Chris Lattner
7246a69d2b
differences between two blockaddress's don't cause a
...
global variable initializer to require relocations.
llvm-svn: 92450
2010-01-03 18:09:40 +00:00
Chris Lattner
af22bc2328
fix refactoro
...
llvm-svn: 92349
2009-12-31 08:23:09 +00:00
Chris Lattner
f9012cc497
use early exits to reduce indentation.
...
llvm-svn: 92335
2009-12-31 02:33:14 +00:00
Chris Lattner
db243bdde8
eliminate another copy of the mdnode printing logic, simplify the
...
one that remains.
llvm-svn: 92334
2009-12-31 02:31:59 +00:00
Chris Lattner
81c909630f
random tidying for MDNode printing.
...
llvm-svn: 92333
2009-12-31 02:27:30 +00:00
Chris Lattner
4776298748
eliminate a bunch of useless forwarding functions with one caller.
...
llvm-svn: 92332
2009-12-31 02:23:35 +00:00
Chris Lattner
ffb8ade190
make mdnMap type safe, rename accessors for consistency with the rest of llvm.
...
llvm-svn: 92331
2009-12-31 02:20:11 +00:00
Chris Lattner
2e52832769
metadata can't be a global var initializer.
...
llvm-svn: 92330
2009-12-31 02:15:45 +00:00
Chris Lattner
0017de9a80
simplify mdnode printing logic. Now N->dump() only
...
dumps one node instead of all of them.
llvm-svn: 92329
2009-12-31 02:13:35 +00:00
Chris Lattner
63181672c5
unify two copies of the NamedMDNode printing code.
...
llvm-svn: 92327
2009-12-31 01:54:05 +00:00
Chris Lattner
d40fbce519
fix printing of function-local metadata to print all the operands of the
...
mdnode, not just operand 0 over and over.
llvm-svn: 92326
2009-12-31 01:44:44 +00:00
Chris Lattner
5922bf638c
simplify printing of mdstring and Argument.
...
llvm-svn: 92325
2009-12-31 01:41:14 +00:00
Chris Lattner
a3660e707c
simplify asmprinting of NamedMDNode
...
llvm-svn: 92324
2009-12-31 01:36:50 +00:00
Chris Lattner
8e4ab636ed
Remove #include of metadata.h from intrinsicinst.h. The only
...
method that needs it (DbgValueInst::getValue) has been moved out
of line.
llvm-svn: 92323
2009-12-31 01:32:41 +00:00
Chris Lattner
c12382b7c8
rename "elements" of metadata to "operands". "Elements" are
...
things that occur in types. "operands" are things that occur
in values.
llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner
9afb6e9c27
Optimize MDNode to coallocate the operand list immediately
...
after the MDNode in memory. This eliminates the operands
pointer and saves a new[] per node.
Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary. A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related! Debug info should use something non-mdnode for
declarations.
llvm-svn: 92321
2009-12-31 01:05:46 +00:00
Chris Lattner
b2de9bbb5e
do not bother reuniquing mdnodes whose operands drop to null. Doing
...
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway. This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g
from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/
llvm-svn: 92315
2009-12-30 21:42:11 +00:00
Chris Lattner
f3520d2c35
remove some misleading comments.
...
llvm-svn: 92311
2009-12-30 20:25:09 +00:00
Chris Lattner
86c74f4783
Do not crash when .ll printing metadata that smells like debug info, but isn't.
...
llvm-svn: 92268
2009-12-29 21:17:33 +00:00
Chris Lattner
84e9de4a58
Final step in the metadata API restructuring: move the
...
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.
llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Chris Lattner
fde39fb4f6
privatize another interface.
...
llvm-svn: 92255
2009-12-29 07:56:15 +00:00
Chris Lattner
c39498971e
the only call to this function (from clang) has been removed, zap it.
...
llvm-svn: 92254
2009-12-29 07:50:09 +00:00
Chris Lattner
dcc5032728
remove some unneeded Metadata interfaces.
...
llvm-svn: 92252
2009-12-29 07:44:16 +00:00
Chris Lattner
110fc20bd8
tidy up debug info comments, use ->isVoidTy() where reasonable.
...
llvm-svn: 92249
2009-12-29 07:25:48 +00:00
Chris Lattner
e7990f78bf
When doing v1->RAUW(v2), don't do anything to metadata. We don't know
...
why one was replaced with the other. Even in the specific case of
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.
llvm-svn: 92241
2009-12-29 02:53:52 +00:00
Chris Lattner
692c53dbf0
sink the Instruction::HasMetadata bit into SubclassData.
...
llvm-svn: 92240
2009-12-29 02:46:09 +00:00
Chris Lattner
2c82be93e6
add a layer of accessors around the Value::SubClassData member, and use
...
a convention (shadowing the setter with private forwarding function) to
prevent subclasses from accidentally using it.
This exposed some bogosity in ConstantExprs, which was propaging the
opcode of the constant expr into the NUW/NSW/Exact field in the
getWithOperands/getWithOperandReplaced methods.
llvm-svn: 92239
2009-12-29 02:14:09 +00:00
Chris Lattner
9ec640a902
This is a major cleanup of the instruction metadata interfaces that
...
I asked Devang to do back on Sep 27. Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().
This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte. Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.
This also fixes some confusion in getMDs and its clients about
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.
This introduces a number of fixme's which I'll follow up on.
llvm-svn: 92235
2009-12-28 23:41:32 +00:00
Chris Lattner
8ca10b9e64
add IRBuilder.cpp to cmake
...
llvm-svn: 92233
2009-12-28 21:52:41 +00:00
Chris Lattner
28de6cdbf5
remove #include of Function.h from IRBuilder
...
llvm-svn: 92231
2009-12-28 21:50:56 +00:00
Chris Lattner
e70c40e8ac
move debug info stuff out of line, allowing two #includes
...
to go away from IRBuilder.h
llvm-svn: 92230
2009-12-28 21:45:40 +00:00
Chris Lattner
e0b9847223
split code that doesn't need to be templated out of IRBuilder into a new
...
non-templated IRBuilderBase class. Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h
llvm-svn: 92227
2009-12-28 21:28:46 +00:00
Chris Lattner
cd3aa9d1ff
rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
...
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.
llvm-svn: 92225
2009-12-28 20:45:51 +00:00
Chris Lattner
2b65f2d7d4
rename getHandlerNames to getMDKindNames, simplify its interface
...
and simplify all the clients that use it.
llvm-svn: 92224
2009-12-28 20:10:43 +00:00
Chris Lattner
5420d062f6
tidy up and delete a dead smallvector.
...
llvm-svn: 92223
2009-12-28 19:49:00 +00:00
Chris Lattner
8c6fbdc63e
avoid a completely unneeded linear walk.
...
llvm-svn: 92221
2009-12-28 09:32:10 +00:00
Chris Lattner
9229f79945
Eliminate two bits of ugliness in MDNode::replaceElement:
...
eliminate the temporary smallvector, and only do FindNodeOrInsertPos
twice if the first one succeeds and we delete a node.
llvm-svn: 92220
2009-12-28 09:24:53 +00:00
Chris Lattner
e36f3cf0ca
rearrange some methods, no functionality change.
...
llvm-svn: 92219
2009-12-28 09:12:35 +00:00
Chris Lattner
2cfabb2151
avoid temporary CallbackVH's.
...
llvm-svn: 92218
2009-12-28 09:10:16 +00:00
Chris Lattner
14d3bc91c4
Rewrite the function-local validation logic for MDNodes (most of r91708).
...
Among other benefits, this doesn't leak the SmallPtrSet, has the verifier
code in the verifier pass, actually does the verification at the end,
and is considerably simpler.
llvm-svn: 92217
2009-12-28 09:07:21 +00:00
Chris Lattner
fcc7918518
rename MDNode instance variables to something meaningful.
...
llvm-svn: 92216
2009-12-28 08:48:12 +00:00
Chris Lattner
2f436b213d
snip one more #include from Metadata.h
...
llvm-svn: 92214
2009-12-28 08:30:43 +00:00
Chris Lattner
77f471055d
prune some #includes
...
llvm-svn: 92212
2009-12-28 08:24:16 +00:00
Chris Lattner
739292d361
change the strange MetadataContext::getMDs function to expose less
...
irrelevant internal implementation details to clients.
llvm-svn: 92210
2009-12-28 08:14:54 +00:00
Chris Lattner
4967dbad20
change NamedMDNode to use a pimpl for its operand list instead
...
of making it a declared part of the value.
llvm-svn: 92209
2009-12-28 08:07:14 +00:00
Chris Lattner
19c825e082
move ElementVH out of the MDNode class into the MDNode.cpp file. Among
...
other things, this avoids vtable and rtti data for it being splatted in
every translation unit that uses it.
llvm-svn: 92207
2009-12-28 07:41:54 +00:00
Bill Wendling
c49babee26
Avoid assigning to Changed when it won't be used after the return.
...
llvm-svn: 92160
2009-12-25 13:50:18 +00:00
John McCall
57eaeeca78
Qualify a bunch of explicit template instantiations to satisfy clang++.
...
llvm-svn: 91736
2009-12-19 00:55:12 +00:00
John McCall
fdae393452
Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
...
the templates in TypesContext.h can find them. Caught by clang++.
llvm-svn: 91735
2009-12-19 00:51:42 +00:00
Eli Friedman
a5dba5246a
Fix gcc warning.
...
llvm-svn: 91715
2009-12-18 21:07:18 +00:00
Rafael Espindola
c58aaaf793
Catch more cases of a pointer being marked garbage twice. This helps when
...
debugging some leaks (PR5770 in particular).
llvm-svn: 91713
2009-12-18 20:35:38 +00:00
Victor Hernandez
44652ca549
Formalize MDNode's function-localness:
...
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local
Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().
llvm-svn: 91708
2009-12-18 20:09:14 +00:00
Dan Gohman
3ceb7c0c47
Add utility routines for NSW multiply.
...
llvm-svn: 91664
2009-12-18 03:10:26 +00:00
Dan Gohman
6bb50740f4
Add utility routines for creating integer negation operators with NSW set.
...
Integer negation only overflows with INT_MIN, but that's an important case.
llvm-svn: 91662
2009-12-18 02:58:50 +00:00
Jeffrey Yasskin
9afe974318
This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
...
llvm-svn: 91611
2009-12-17 19:55:06 +00:00
Eli Friedman
5c7e38b936
Aggressively flip compare constant expressions where appropriate; constant
...
folding in particular expects null to be on the RHS.
llvm-svn: 91587
2009-12-17 06:07:04 +00:00
Victor Hernandez
f6bcc2747e
Use different name for argument and field
...
llvm-svn: 91524
2009-12-16 08:10:57 +00:00
Victor Hernandez
e91192950c
MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
...
llvm-svn: 91497
2009-12-16 02:52:09 +00:00
Chris Lattner
587962c667
Remove isPod() from DenseMapInfo, splitting it out to its own
...
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.
llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Dan Gohman
d16b19ff3e
Move several function bodies which are rarely inlined out of line.
...
llvm-svn: 91319
2009-12-14 19:43:09 +00:00
Duncan Sands
d73da0fbb9
Add utility method for determining whether a function argument
...
has the 'nest' attribute.
llvm-svn: 91109
2009-12-11 08:36:17 +00:00
Benjamin Kramer
2d6d1651cf
Remove useless calls to c_str().
...
llvm-svn: 90855
2009-12-08 13:07:38 +00:00
Chris Lattner
acc9c4f542
whitespace cleanup
...
llvm-svn: 90834
2009-12-08 05:31:46 +00:00
Anton Korobeynikov
fadc276b81
Add MSP430 interrupt calling conv. No functionality change yet.
...
llvm-svn: 90738
2009-12-07 02:27:35 +00:00
Victor Hernandez
e865bc76ad
Avoid creating a metadata slot for all metadata that contains an instruction
...
llvm-svn: 90581
2009-12-04 20:07:10 +00:00
Victor Hernandez
aae1944c56
Fix crasher when N->getElement(n) is NULL
...
llvm-svn: 90572
2009-12-04 18:29:23 +00:00
Andreas Neustifter
c427ec12c0
Added debug output for inherited passes that are invalidated.
...
llvm-svn: 90553
2009-12-04 06:58:24 +00:00
Victor Hernandez
8baca1a2de
Teach AsmWriter to write inline (not via a global metadata slot) metadata that contains an instruction
...
llvm-svn: 90512
2009-12-04 01:35:02 +00:00
Chris Lattner
9ce833945e
improve portability to avoid conflicting with std::next in c++'0x.
...
Patch by Howard Hinnant!
llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Nick Lewycky
44573bb42b
Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
...
for pointing this out.
llvm-svn: 90015
2009-11-27 19:57:53 +00:00
Nick Lewycky
c0a516186a
Fix typo spotted by Gabor Greif.
...
llvm-svn: 89976
2009-11-26 23:19:05 +00:00
Nick Lewycky
07c3eb54a4
Clean up file, no functionality change.
...
llvm-svn: 89974
2009-11-26 22:54:26 +00:00
Dan Gohman
29dbc79996
Move FunctionPassManagerImpl's dumpArguments and dumpPasses calls
...
out of its run function and into its doInitialization method, so
that it does the dump once instead of once per function.
llvm-svn: 89660
2009-11-23 16:24:18 +00:00
Duncan Sands
efd23f129e
I forgot to update the prototype for LLVMBuildIntCast when correcting
...
the body to not pass the name for the isSigned parameter. However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL! Some other C function needs to be introduced for the general
case of signed or unsigned casts. This hopefully unbreaks the ocaml
binding.
llvm-svn: 89648
2009-11-23 10:49:03 +00:00
Nick Lewycky
deb3d7dfbc
Start catching LLVMContext misuse in the verifier.
...
llvm-svn: 89646
2009-11-23 04:52:00 +00:00
Jeffrey Yasskin
135f2adcbb
In GlobalVariable::setInitializer, assert that the initializer has the
...
right type.
llvm-svn: 89014
2009-11-17 00:43:13 +00:00
Duncan Sands
0503912f83
BuildIntCast takes an additional parameter, isSigned.
...
llvm-svn: 88910
2009-11-16 13:15:28 +00:00
Evan Cheng
9b306a1e32
Special case FixedStackPseudoSourceValueVal as well. Do we really need to differentiate PseudoSourceValueVal from FixedStackPseudoSourceValueVal at this level?
...
llvm-svn: 88902
2009-11-16 07:10:36 +00:00
Eric Christopher
9b6ef0d374
Remove extraneous commit.
...
llvm-svn: 88716
2009-11-13 23:08:47 +00:00
Eric Christopher
14bf8d4de6
Print out something, even if it's non-parseable later when we've
...
got ghost linkage. It's better than aborting.
llvm-svn: 88715
2009-11-13 23:00:14 +00:00
Devang Patel
c70b8eefb7
Do not use StringRef in DebugInfo interface.
...
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!
llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Chris Lattner
a3457e6bae
Reject duplicate case values in a switch, PR5450.
...
llvm-svn: 86846
2009-11-11 17:37:02 +00:00
Victor Hernandez
70963992b8
make this handle redefinition of malloc function with different prototype correctly
...
llvm-svn: 86712
2009-11-10 19:53:28 +00:00
Jeffrey Yasskin
23ac706aab
Fix DenseMap iterator constness.
...
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.
The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.
Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.
Patch by Victor Zverovich!
llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Daniel Dunbar
886e51b5c1
Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
...
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.
llvm-svn: 86630
2009-11-10 00:43:58 +00:00
Chris Lattner
91fe2102eb
make this handle redefinition of malloc with different prototype correctly.
...
llvm-svn: 86525
2009-11-09 07:12:01 +00:00
Chris Lattner
f8b7276e30
prune #include / layering violation
...
llvm-svn: 86365
2009-11-07 09:07:01 +00:00
Victor Hernandez
8275ebb927
Fit in 80 columns
...
llvm-svn: 86316
2009-11-07 00:36:50 +00:00
Victor Hernandez
8736a8fca4
Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.
...
Here is the original commit message:
This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.
Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.
Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.
Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
llvm-svn: 86311
2009-11-07 00:16:28 +00:00
Victor Hernandez
fe6fe378ce
CallInst::CreateMalloc() and CallInst::CreateFree() need to create calls with correct calling convention
...
llvm-svn: 86290
2009-11-06 21:43:21 +00:00
Daniel Dunbar
4daaf9d3f4
Pass StringRef by value.
...
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chris Lattner
903ae55e1c
remove a bunch of extraneous LLVMContext arguments
...
from various APIs, addressing PR5325.
llvm-svn: 86231
2009-11-06 04:27:31 +00:00
Victor Hernandez
a5a12cd62e
Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
...
llvm-svn: 86213
2009-11-06 01:33:24 +00:00
Victor Hernandez
21ec158c23
Update CreateMalloc so that its callers specify the size to allocate:
...
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.
Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.
Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
llvm-svn: 86077
2009-11-05 00:03:03 +00:00
Victor Hernandez
628b65ea6e
Changes requested (avoid getFunction(), avoid Type creation via isVoidTy(), and avoid redundant isFreeCall cases) in feedback to r85176
...
llvm-svn: 85936
2009-11-03 20:39:35 +00:00
Chris Lattner
ad2926bbb4
remove a bunch of locking from LLVMContextImpl. Since only one thread
...
can be banging on a context at a time, this isn't needed. Owen, please
review.
llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Chris Lattner
55a53e4e79
the verifier shouldn't modify the IR.
...
llvm-svn: 85722
2009-11-01 18:11:50 +00:00
Chris Lattner
baa216cd33
fix an issue where the verifier would reject a function whose entry
...
block had its address taken even if the blockaddress was dead.
llvm-svn: 85706
2009-11-01 04:08:01 +00:00
Chris Lattner
6e87bdadb9
Fix BlockAddress::replaceUsesOfWithOnConstant to correctly
...
maintain the block use count in SubclassData.
llvm-svn: 85701
2009-11-01 03:03:03 +00:00
Chris Lattner
2bbe57b2b8
Revert 85678/85680. The decision is to stay with the current form of
...
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.
llvm-svn: 85699
2009-11-01 01:27:45 +00:00
Chris Lattner
cbab35746f
Make blockaddress(@func, null) be valid, and make 'deleting a basic
...
block with a blockaddress still referring to it' replace the invalid
blockaddress with a new blockaddress(@func, null) instead of a
inttoptr(1).
This changes the bitcode encoding format, and still needs codegen
support (this should produce a non-zero value, referring to the entry
block of the function would also be quite reasonable).
llvm-svn: 85678
2009-10-31 20:08:37 +00:00
Chris Lattner
3982885b51
if basic blocks are destroyed while there are *just* BlockAddress' hanging
...
around, then zap them. This is analogous to dangling constantexprs hanging
off functions.
llvm-svn: 85627
2009-10-30 22:39:36 +00:00
Chris Lattner
74ed905748
make hasAddressTaken() constant time by storing a refcount in BB's subclass data.
...
llvm-svn: 85625
2009-10-30 22:33:29 +00:00
Chris Lattner
5b38f2ec49
it isn't valid to take the address of the entry block.
...
llvm-svn: 85621
2009-10-30 22:15:48 +00:00
Dan Gohman
42e985b07a
Simplify this code and avoid an extra space character in the output.
...
llvm-svn: 85568
2009-10-30 02:01:10 +00:00
Chris Lattner
57a8d8d4e0
add sanity check for indbr.
...
llvm-svn: 85496
2009-10-29 05:53:32 +00:00
Dan Gohman
c80f1a4033
Add a hasAddressTaken for BasicBlock.
...
llvm-svn: 85449
2009-10-29 00:09:08 +00:00
Chris Lattner
f605b2e8f9
Previously, all operands to Constant were themselves constant.
...
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.
llvm-svn: 85375
2009-10-28 05:14:34 +00:00
Chris Lattner
c22b8deb03
'static const void *X = &&y' can only be put in the
...
readonly section if a reference to the containing function
is valid in the readonly section.
llvm-svn: 85370
2009-10-28 04:12:16 +00:00
Chris Lattner
a1aa8a092d
asmprinter support for BlockAddress.
...
llvm-svn: 85367
2009-10-28 03:38:12 +00:00
Chris Lattner
24819a6e06
when we tear down a module, we need to be careful to
...
zap BlockAddress values.
llvm-svn: 85366
2009-10-28 03:37:35 +00:00
Chris Lattner
2bc8002f4c
rename indbr -> indirectbr to appease the residents of #llvm.
...
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
28895dac5b
IR support for the new BlockAddress constant kind. This is
...
untested and there is no way to use it, next up: doing battle
with asmparser.
llvm-svn: 85349
2009-10-28 00:01:44 +00:00
Jeffrey Yasskin
173c58db88
Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoid
...
colliding with llvm/ADT/ValueMap.h:ValueMap<>.
llvm-svn: 85344
2009-10-27 23:45:55 +00:00
Devang Patel
b7572e3783
Factor out redundancy from clone() implementations.
...
llvm-svn: 85327
2009-10-27 22:16:29 +00:00
Victor Hernandez
0f662a7acf
Rename MallocFreeHelper as MemoryBuiltins
...
llvm-svn: 85286
2009-10-27 20:05:49 +00:00
Chris Lattner
fdda543cea
add enough support for indirect branch for the feature test to pass
...
(assembler,asmprinter, bc reader+writer) and document it. Codegen
currently aborts on it.
llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Chris Lattner
fa5b1df64a
Type.h doesn't need to #include LLVMContext.h
...
llvm-svn: 85254
2009-10-27 17:08:31 +00:00
Victor Hernandez
6c86b93663
Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
...
llvm-svn: 85181
2009-10-26 23:58:56 +00:00
Victor Hernandez
673c036bc7
Remove FreeInst.
...
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.
llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Devang Patel
9027c8f10f
Do not use expensive sort().
...
llvm-svn: 85130
2009-10-26 17:09:00 +00:00
Nick Lewycky
2b8400628d
Remove includes of Support/Compiler.h that are no longer needed after the
...
VISIBILITY_HIDDEN removal.
llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky
711c726c97
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.
llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Nick Lewycky
cacdc4d65a
Remove ICmpInst::isSignedPredicate which was a reimplementation
...
CmpInst::isSigned.
llvm-svn: 85037
2009-10-25 05:20:17 +00:00
Nick Lewycky
a16e115bd4
Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqual
...
which is equal to !isTrueWhenEqual for ints but not for floats.
llvm-svn: 85036
2009-10-25 03:50:03 +00:00
Dan Gohman
e970f8a450
Make DominanceFrontierBase::print's output prettier.
...
llvm-svn: 85011
2009-10-24 20:01:11 +00:00
Victor Hernandez
e8998896f5
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.
llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Victor Hernandez
8428eb5720
Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
...
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Devang Patel
5c461d6dcd
Hide MetadataContext implementation details.
...
llvm-svn: 84886
2009-10-22 19:36:54 +00:00
Devang Patel
2a0e2f1794
Fix getMDs() interface such that it does not expose implementation details.
...
llvm-svn: 84885
2009-10-22 18:55:16 +00:00
Devang Patel
1fa3e26912
Using TrackingVH instead of WeakVH or WeakMetadataVH.
...
llvm-svn: 84884
2009-10-22 18:25:28 +00:00
Devang Patel
944cbf7647
Sort handler names to ensure deterministic behavior.
...
llvm-svn: 84878
2009-10-22 17:40:37 +00:00
Devang Patel
6df2865e24
Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
...
llvm-svn: 84820
2009-10-22 01:01:24 +00:00
Devang Patel
125861a48c
Use StringRef to construct MDString.
...
llvm-svn: 84811
2009-10-22 00:22:05 +00:00
Devang Patel
068e5420ce
Remove meaningless const.
...
Pass StringRef by value.
llvm-svn: 84804
2009-10-22 00:10:15 +00:00
Devang Patel
f9d56f4830
Derive metadata hierarchy from Value instead of User.
...
llvm-svn: 84801
2009-10-21 23:57:35 +00:00
Benjamin Kramer
1af3b8ca4d
Fix thinko noticed by Chris.
...
llvm-svn: 84797
2009-10-21 23:29:32 +00:00
Dale Johannesen
2bb120a97f
Rename msasm to alignstack per review.
...
llvm-svn: 84795
2009-10-21 23:28:00 +00:00
Benjamin Kramer
87ca5b37b6
Remove pointless return; at end of function.
...
llvm-svn: 84794
2009-10-21 23:27:54 +00:00
Benjamin Kramer
a5cb240184
Simplify code. No intended functionality change.
...
llvm-svn: 84790
2009-10-21 22:55:51 +00:00
Devang Patel
7e3d4b199c
Use StringRef.
...
llvm-svn: 84786
2009-10-21 21:57:13 +00:00
Devang Patel
d10159397a
Do not use SmallVector to store MDNode elements.
...
llvm-svn: 84784
2009-10-21 21:25:09 +00:00
Devang Patel
7137e5f065
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
llvm-svn: 84765
2009-10-21 17:33:41 +00:00
Devang Patel
7edc7aa34d
Cosmetic changes.
...
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g
llvm-svn: 84689
2009-10-20 22:50:27 +00:00
Owen Anderson
fb4db70d0f
Banish ConstantsLock. It's serving no purpose other than slowing things down
...
at the moment.
llvm-svn: 84529
2009-10-19 20:11:52 +00:00
Chris Lattner
1971f7636b
various cleanups.
...
llvm-svn: 84471
2009-10-19 07:10:59 +00:00
Nick Lewycky
4f6c397742
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.
llvm-svn: 84374
2009-10-17 23:52:26 +00:00
Chris Lattner
2c890dc2b4
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.
llvm-svn: 84368
2009-10-17 21:53:27 +00:00
Nick Lewycky
92413b8e2e
Emit newlines at the end of instructions too.
...
llvm-svn: 84348
2009-10-17 19:43:45 +00:00
Daniel Dunbar
d0736f38d7
Remove unnecessary include.
...
llvm-svn: 84336
2009-10-17 18:11:57 +00:00
Victor Hernandez
a25a2890fa
Remove MallocInst from LLVM Instructions.
...
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Victor Hernandez
4d7283f82c
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.
llvm-svn: 84292
2009-10-17 00:00:19 +00:00
Devang Patel
95b6efe972
Add copyMD to copy metadata from one instruction to another instruction.
...
llvm-svn: 84113
2009-10-14 17:02:49 +00:00
Duncan Sands
4fcf6123dd
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).
llvm-svn: 84106
2009-10-14 16:11:37 +00:00
Dale Johannesen
7db511a23e
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.
llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Devang Patel
729589a539
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.
...
llvm-svn: 83977
2009-10-13 17:00:54 +00:00
Nick Lewycky
ee0c1726d8
Force memory use markers to have a ConstantInt for the size argument.
...
llvm-svn: 83960
2009-10-13 07:57:33 +00:00
Jeffrey Yasskin
7d85d5a366
Fix http://llvm.org/PR5160 , to let CallbackVHs modify other ValueHandles on the
...
same Value without breaking things.
llvm-svn: 83861
2009-10-12 17:43:32 +00:00
Chris Lattner
b2e0e6c46b
add some more hooks to the C bindings, patch by Kenneth Uildriks!
...
llvm-svn: 83821
2009-10-12 04:01:02 +00:00
Dan Gohman
68e044e81a
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.
llvm-svn: 83555
2009-10-08 17:00:02 +00:00
Devang Patel
c411175393
Do not assume that the module is set.
...
llvm-svn: 83462
2009-10-07 16:37:55 +00:00
Duncan Sands
27cb155f76
Make getPointerTo return a const PointerType* rather than
...
an unqualified PointerType* because it seems more correct.
llvm-svn: 83454
2009-10-07 07:35:19 +00:00
Duncan Sands
2400ad7236
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.
llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Chris Lattner
a3cf123e86
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.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Nick Lewycky
5bf0eb2dd5
Requires element types in a constant initializer to match the element types of
...
of the constant. This reverts r6544 and r7428.
llvm-svn: 83270
2009-10-03 19:30:43 +00:00
Devang Patel
43ce9e3e75
Check for null MDNode element while printing comment.
...
llvm-svn: 83172
2009-09-30 21:26:51 +00:00
Jeffrey Yasskin
2d4f3f6704
Assert that ConstantArrays are created with correctly-typed elements.
...
llvm-svn: 83168
2009-09-30 21:08:08 +00:00
Devang Patel
24270e88cc
Print tag name for MDNodes that are used to encode debug info.
...
llvm-svn: 83160
2009-09-30 20:16:54 +00:00
Devang Patel
c1e370a29c
Lookup handler name only when assertions are enabled.
...
llvm-svn: 83114
2009-09-29 22:05:52 +00:00
Devang Patel
39b5b72d74
Add removeMD().
...
llvm-svn: 83107
2009-09-29 20:42:25 +00:00
Devang Patel
292bcd8ca1
Only one custom meadata of each kind can be attached with an instruction.
...
llvm-svn: 83105
2009-09-29 20:30:57 +00:00
Devang Patel
351585921d
Use assertion instead of early exit to catch malformed custom metadata store.
...
llvm-svn: 83102
2009-09-29 20:01:19 +00:00
Devang Patel
629ad89954
Parse custom metadata attached with an instruction.
...
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Dan Gohman
74e63461d2
Add C API calls for building FNeg operations. Patch by KS Sreeram!
...
llvm-svn: 83021
2009-09-28 21:51:41 +00:00
Devang Patel
1070b7a713
s/class Metadata/class MetadataContext/g
...
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
d836a7d651
Do not use global typedef for MDKindID.
...
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Devang Patel
9e2af6ed0b
Do not hardcode metadata names.
...
llvm-svn: 83010
2009-09-28 20:56:00 +00:00
Devang Patel
5a52b71500
Remove dead code.
...
llvm-svn: 82999
2009-09-28 18:31:56 +00:00
Dan Gohman
584645dfe8
Remove temporary debugging hack.
...
llvm-svn: 82953
2009-09-28 00:44:15 +00:00
Dan Gohman
bd50ec69e4
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.
llvm-svn: 82952
2009-09-28 00:27:48 +00:00
Dan Gohman
09f5f7f190
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.
llvm-svn: 82949
2009-09-28 00:07:05 +00:00
Dan Gohman
fdd9a2ee96
Extract the code for releasing a pass into a separate function, and
...
tidy it up a little.
llvm-svn: 82944
2009-09-27 23:38:27 +00:00
Nick Lewycky
04cea17209
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.
llvm-svn: 82943
2009-09-27 23:27:42 +00:00
Nick Lewycky
81504d2150
Round out the API for the new optimization flags.
...
llvm-svn: 82930
2009-09-27 21:33:04 +00:00
Dan Gohman
eb9dbb2bd2
Micro-optimize DerivedType::dropAllTypeUses.
...
llvm-svn: 82900
2009-09-27 15:32:21 +00:00
Nick Lewycky
676778014b
Remove dead code from this function and optimize. Update its corresponding
...
LangRef entry too.
llvm-svn: 82890
2009-09-27 07:55:32 +00:00
Nick Lewycky
d21c325f09
Instruction::clone does not need to take an LLVMContext&. Remove that and
...
update all the callers.
llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Duncan Sands
ec5d64fdd5
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.
llvm-svn: 82862
2009-09-26 15:35:35 +00:00
Dan Gohman
d585364b0b
Rename ConstantFP's getInf to getInfinity.
...
llvm-svn: 82823
2009-09-25 23:40:21 +00:00
Dan Gohman
01b2c857ed
Add a ConstantFP::getInf utility function for creating infinity ConstantFPs.
...
llvm-svn: 82818
2009-09-25 23:00:48 +00:00
Victor Hernandez
f772c0b8b2
Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
...
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Victor Hernandez
ff8027ced6
Auto-upgrade malloc instructions to malloc calls.
...
Reviewed by Devang Patel.
llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Devang Patel
2b6906a18d
Move parent assertion check before metadata deletion.
...
llvm-svn: 82692
2009-09-24 16:19:11 +00:00
Devang Patel
6709bea96c
Delete attached metadata when an instruction is deleted.
...
llvm-svn: 82647
2009-09-23 20:33:51 +00:00
Devang Patel
18dae0848f
Do not leave behind metadata while cloning an instruction.
...
llvm-svn: 82638
2009-09-23 18:32:25 +00:00
Dan Gohman
8b2d3ef326
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.
llvm-svn: 82599
2009-09-23 01:33:16 +00:00
Victor Hernandez
d2cc74eb2d
No need to verify that malloc's return type is i8*.
...
llvm-svn: 82561
2009-09-22 18:50:03 +00:00
Daniel Dunbar
34413e6018
Fix commento.
...
llvm-svn: 82544
2009-09-22 10:30:34 +00:00
Daniel Dunbar
6d5513977b
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.
llvm-svn: 82506
2009-09-22 02:02:33 +00:00
Chris Lattner
611a14fce0
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.
llvm-svn: 82491
2009-09-21 22:39:35 +00:00
Chris Lattner
1ceac42392
move DominatorTree::dominates for instructions out of line,
...
no functionality change.
llvm-svn: 82490
2009-09-21 22:30:50 +00:00
Chris Lattner
78d19af97a
tidy up
...
llvm-svn: 82489
2009-09-21 22:27:34 +00:00
Nuno Lopes
cdb4b7116b
initialize SymbolsCanStartWithDigit to false by default
...
llvm-svn: 82454
2009-09-21 14:11:56 +00:00
Nick Lewycky
ecb17d4648
Peer through zext and sext to eliminate them when it is safe to do so.
...
llvm-svn: 82389
2009-09-20 07:31:25 +00:00
Nick Lewycky
991c5185bb
Fold 'icmp eq (icmp), true' into an xor(icmp).
...
llvm-svn: 82386
2009-09-20 07:21:39 +00:00
Nick Lewycky
cd6475ebe9
Correct the comment; this applies to fcmp too.
...
llvm-svn: 82380
2009-09-20 06:27:35 +00:00
Nick Lewycky
13510f330b
Remove tab, again.
...
llvm-svn: 82379
2009-09-20 06:26:34 +00:00
Nick Lewycky
5cbc7c4ae9
Teach the constant folder how to not a cmpinst.
...
llvm-svn: 82378
2009-09-20 06:24:51 +00:00
Nick Lewycky
93d1111b1c
Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
...
the hopes that the two bitcasts will merge.
llvm-svn: 82371
2009-09-20 05:48:50 +00:00
Nick Lewycky
b96f9df101
Remove tabs I added.
...
llvm-svn: 82369
2009-09-20 05:47:45 +00:00
Nick Lewycky
42065f1555
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.
llvm-svn: 82361
2009-09-20 04:27:06 +00:00
Daniel Dunbar
4e33798de0
Strip trailing whitespace.
...
llvm-svn: 82359
2009-09-20 04:03:34 +00:00
Nick Lewycky
261d7a49b1
Remove dead store by taking a guess at what Chris meant. I wasn't able to
...
design a testcase that would tickle this behaviour.
llvm-svn: 82357
2009-09-20 03:48:46 +00:00
Daniel Dunbar
378331a13d
Tabs -> spaces, and remove trailing whitespace.
...
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Nick Lewycky
79db45a852
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.
llvm-svn: 82353
2009-09-20 02:11:47 +00:00
Nick Lewycky
ca1f29ee1b
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.
llvm-svn: 82349
2009-09-20 01:35:59 +00:00
Nick Lewycky
6ad3b51864
Teach the constant folder how to handle a few simple i1 cases.
...
llvm-svn: 82340
2009-09-20 00:04:02 +00:00
Devang Patel
c195f74dee
Write and read metadata attachments.
...
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Victor Hernandez
065bc44d01
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.
llvm-svn: 82257
2009-09-18 19:20:02 +00:00