Bob Wilson
6f7fd28824
Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
...
llvm-svn: 99948
2010-03-30 22:27:04 +00:00
Mon P Wang
7460571381
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
...
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.
llvm-svn: 99928
2010-03-30 20:55:56 +00:00
Chris Lattner
a3b94ba2c5
move some method definitions to files that make sense.
...
llvm-svn: 99927
2010-03-30 20:48:48 +00:00
Eric Christopher
6ad8167714
Remove the pmulld intrinsic and autoupdate it as a vector multiply.
...
Rewrite the pmulld patterns, and make sure that they fold in loads of
arguments into the instruction.
llvm-svn: 99910
2010-03-30 18:49:01 +00:00
Chris Lattner
707431cf26
reapply my timer rewrite with a change for PassManager to store
...
timers by pointer instead of by-value.
llvm-svn: 99871
2010-03-30 04:03:22 +00:00
Chris Lattner
ec8ef9b643
revert r99862 which is causing FNT failures.
...
llvm-svn: 99870
2010-03-30 03:57:00 +00:00
Chris Lattner
57a0542397
fairly major rewrite of various timing related stuff.
...
llvm-svn: 99862
2010-03-30 02:38:19 +00:00
Chris Lattner
61f3bd6772
add support for zero initialized unions, patch by Tim Northover!
...
llvm-svn: 99818
2010-03-29 17:36:02 +00:00
Jeffrey Yasskin
3f28c8809d
Oops, r98447 dropped the reference to ForwardType in the wrong place in
...
Type::destroy(), so it got skipped for FunctionTypes, StructTypes, and
UnionTypes. This fixes the resulting leaks in test/Feature/opaquetypes.ll and
test/Integer/opaquetypes_bt.ll.
llvm-svn: 99732
2010-03-28 01:03:47 +00:00
Gabor Greif
6c6b2fd2b2
rename pred_const_iterator to const_pred_iterator for consistency's sake
...
llvm-svn: 99567
2010-03-25 23:25:28 +00:00
Gabor Greif
c78d720f02
rename use_const_iterator to const_use_iterator for consistency's sake
...
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Devang Patel
4414711909
Include isFunctionLocal while calculating folding node set profile for a MDNode.
...
llvm-svn: 99490
2010-03-25 06:04:47 +00:00
Devang Patel
c95e6079a4
Include isFunctionLocal while calculating folding node set provide for a MDNode.
...
llvm-svn: 99484
2010-03-25 05:36:13 +00:00
Eric Christopher
b1a382d8b9
Reapply r99451 with a fix to move the NoInline check to the cost functions
...
instead of InlineFunction.
llvm-svn: 99483
2010-03-25 04:49:10 +00:00
Eric Christopher
1d38538fb6
Temporarily revert this, it's causing an issue with an internal project.
...
llvm-svn: 99451
2010-03-24 23:35:21 +00:00
Gabor Greif
a2fbc0ae1b
Finally land the InvokeInst operand reordering.
...
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.
Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.
llvm-svn: 99399
2010-03-24 13:21:49 +00:00
Chris Lattner
00eeac4179
add some accessors to callsite/callinst/invokeinst to check
...
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't. This fixes PR6682.
llvm-svn: 99341
2010-03-23 22:59:07 +00:00
Chris Lattner
ae12e35004
fix an infinite loop in Module::getEndianness, PR6684
...
patch by Alex Mac!
llvm-svn: 99330
2010-03-23 21:48:41 +00:00
Gabor Greif
161cb044f3
add assert in argpromotion, which cannot trigger
...
if Function::hasAddressTaken works as advertised
also included some cosmetic cleanups
llvm-svn: 99276
2010-03-23 14:40:20 +00:00
Gabor Greif
668d700fe3
word-o
...
llvm-svn: 99275
2010-03-23 13:45:54 +00:00
Chris Lattner
2109cb461c
Change intrinsic result type for void to store it as an empty list
...
instead of as a single element list with VoidTy. Now with a fix
for the verifier.
llvm-svn: 99206
2010-03-22 20:56:36 +00:00
Gabor Greif
e1517a084f
backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
...
llvm-svn: 99171
2010-03-22 09:11:00 +00:00
Gabor Greif
7a743e15e3
Now that hopefully all direct accesses to InvokeInst operands are fixed
...
we can reapply the InvokeInst operand reordering patch. (see r98957).
llvm-svn: 99170
2010-03-22 08:28:00 +00:00
Jeffrey Yasskin
a6eedc3c03
Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
...
by dropping all references from all constants that can use other
constants before trying to destroy any of them.
I also had to free bugpoint's Module in ~BugDriver().
llvm-svn: 99160
2010-03-22 05:23:37 +00:00
Jeffrey Yasskin
cd3706cd1c
Re-add the Metadata.h include to LLVMContextImpl.h so that MDNode is complete
...
where FoldingSet<MDNode> is instantiated. Clang and MSVC complain; gcc
doesn't.
llvm-svn: 99147
2010-03-21 22:08:41 +00:00
Jeffrey Yasskin
4cfb3a7656
Move the LLVMContextImpl implementation into a .cpp file.
...
llvm-svn: 99146
2010-03-21 21:17:34 +00:00
Jeffrey Yasskin
ade270e225
Memoize InlineAsms into the LLVMContext and delete them on shutdown.
...
Fixes PR803.
llvm-svn: 99143
2010-03-21 20:37:19 +00:00
Devang Patel
5002454d2a
call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1 )
...
is valid, but not useful, when variable identified by !1 is optimized away by the optimizer.
llvm-svn: 98986
2010-03-19 21:06:24 +00:00
Gabor Greif
6c56ed847e
back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
...
llvm-svn: 98958
2010-03-19 13:50:02 +00:00
Gabor Greif
8335f9c0bf
Recommit r80858 again (which has been backed out in r80871).
...
This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.
Maybe the valgrind bots give me a hint of what may be wrong
(it at all).
llvm-svn: 98957
2010-03-19 11:55:53 +00:00
Chris Lattner
b981fcf2d8
add asmprinter suport for unions, fixing Feature/unions.ll to actually
...
be doing something useful.
llvm-svn: 98677
2010-03-16 21:21:35 +00:00
Chris Lattner
f7aa541107
fix some pointless layering violations.
...
llvm-svn: 98460
2010-03-14 01:56:06 +00:00
Jeffrey Yasskin
0374d7feb0
Allow types that have been forwarded to to be freed.
...
Tested: make check-lit && valgrind --dsymutil=yes --leak-check=full unittests/ExecutionEngine/JIT/Debug/JITTests
llvm-svn: 98447
2010-03-13 20:09:55 +00:00
Jeffrey Yasskin
2cc2476198
Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, r97788.
...
Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit`
after configuring with --with-llvmgccdir (and this did run the
FrontendC* tests this time)
llvm-svn: 98410
2010-03-13 01:26:15 +00:00
Benjamin Kramer
74ca599a73
Remove duplicated code. No functionality change.
...
llvm-svn: 98156
2010-03-10 16:04:20 +00:00
Jeffrey Yasskin
5cdbd7064c
Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
...
the FrontendC* tests. :(
llvm-svn: 97921
2010-03-07 19:26:40 +00:00
Jeffrey Yasskin
aba6ea8254
Reapply r97788 to free MDNodes when the LLVMContext is destroyed. It
...
bootstraps llvm-gcc this time.
llvm-svn: 97918
2010-03-07 18:46:57 +00:00
Nick Lewycky
4b5e95426d
Add verification of union types.
...
llvm-svn: 97889
2010-03-06 20:26:48 +00:00
Jeffrey Yasskin
5c92f933b3
Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
...
llvm-svn: 97792
2010-03-05 06:43:49 +00:00
Jeffrey Yasskin
39e0d52080
Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
...
llvm-svn: 97788
2010-03-05 05:47:09 +00:00
Jeffrey Yasskin
bd8a759589
Stop leaking MDStrings.
...
llvm-svn: 97763
2010-03-04 23:24:19 +00:00
Erick Tryzelaar
444c0955af
Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
...
We need this so can not bake DESTDIR into the O'Caml symlinks.
llvm-svn: 97743
2010-03-04 20:56:19 +00:00
Nick Lewycky
1a7ed5868b
Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
...
transformation much more careful. Truncating binary '01' to '1' sounds like it's
safe until you realize that it switched from positive to negative under a signed
interpretation, and that depends on the icmp predicate.
Also a few miscellaneous cleanups.
llvm-svn: 97721
2010-03-04 06:54:10 +00:00
Chris Lattner
3afc0721c7
fix incorrect folding of icmp with undef, PR6481.
...
llvm-svn: 97659
2010-03-03 19:46:03 +00:00
Erick Tryzelaar
ad0e0cb0df
Add Module functions in place of module providers.
...
llvm-svn: 97608
2010-03-02 23:58:54 +00:00
Erick Tryzelaar
9f9857e98c
Rename LLVMUseIteratorRef to LLVMUseRef since we don't refer to iterators in llvm-c.
...
llvm-svn: 97585
2010-03-02 20:32:28 +00:00
Duncan Sands
d90d594e46
Rather than passing "false" for InsertBefore, AddressSpace for ThreadLocal,
...
and nothing for AddressSpace, pass 0 for InsertBefore, "false" for ThreadLocal
and AddressSpace for AddressSpace. Spotted by gcc-4.5.
llvm-svn: 97563
2010-03-02 11:18:43 +00:00
Erick Tryzelaar
72a37135fb
Fix looking up MD names to not need a module.
...
llvm-svn: 97550
2010-03-02 05:32:52 +00:00
Dan Gohman
74b189fcb2
Don't print "Modified" for passes which haven't modified anything.
...
llvm-svn: 97446
2010-03-01 17:34:28 +00:00
Erick Tryzelaar
06894b3824
Add support for global variables in an address space for llvm-c and ocaml.
...
llvm-svn: 97377
2010-02-28 09:46:13 +00:00
Erick Tryzelaar
0fb26ef01f
Add indirect br support to llvm-c and ocaml.
...
llvm-svn: 97376
2010-02-28 09:46:06 +00:00
Erick Tryzelaar
d8531faf95
Add metadata functions to llvm-c and ocaml.
...
llvm-svn: 97375
2010-02-28 09:45:59 +00:00
Erick Tryzelaar
4c340c7f7f
Add the new builder arthmetic instructions to llvm-c and ocaml.
...
llvm-svn: 97372
2010-02-28 05:51:43 +00:00
Erick Tryzelaar
a8053dfd27
Add the new union arthmetic instructions to llvm-c and ocaml.
...
llvm-svn: 97371
2010-02-28 05:51:33 +00:00
Erick Tryzelaar
318317961c
Add generic binary op and cast builder functions.
...
llvm-svn: 97370
2010-02-28 05:51:27 +00:00
Dale Johannesen
e6b53047bb
Add type printing for Metadata pseudo.
...
llvm-svn: 97251
2010-02-26 19:38:59 +00:00
Dan Gohman
a2684dbff0
Teach the constant folder about union types.
...
llvm-svn: 97142
2010-02-25 16:45:19 +00:00
Dan Gohman
935faff0bd
Remove code which assumes it knows how vectors are stored in memory.
...
llvm-svn: 97141
2010-02-25 16:05:33 +00:00
Nick Lewycky
ba8ec9a9e4
Dump the presence of attached metadata even if we don't know what it is. This
...
format is not parsable, even if the module is legal. To get parsable output,
dump the module instead of the function or smaller, since metadata kind are
attached to the module (not the context).
llvm-svn: 97124
2010-02-25 06:53:04 +00:00
Dan Gohman
6c5ac6de5c
Canonicalize ConstantInts to the right operand of commutative
...
operators.
The test difference is just due to the multiplication operands
being commuted (and thus requiring a more elaborate match). In
optimized code, that expression would be folded.
llvm-svn: 96816
2010-02-22 22:43:23 +00:00
Dan Gohman
6eeabaad2b
Use Instruction::isCommutative instead of duplicating it.
...
llvm-svn: 96807
2010-02-22 22:05:18 +00:00
Talin
1feba3c980
replaceUsesOfWithOnConstant implementation for unions.
...
llvm-svn: 96616
2010-02-18 21:43:45 +00:00
Devang Patel
82ab3f8727
Destroy MDNodes gracefully while deleting llvm context.
...
llvm-svn: 96609
2010-02-18 20:53:16 +00:00
Kenneth Uildriks
10e3022b10
Function attributes have index ~0, not 0
...
llvm-svn: 96370
2010-02-16 19:28:02 +00:00
Duncan Sands
cbd43f89ac
Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
...
methods to try to have the type predicates be more logically positioned.
llvm-svn: 96349
2010-02-16 14:50:09 +00:00
Duncan Sands
19d0b47b1f
There are two ways of checking for a given type, for example isa<PointerType>(T)
...
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Nick Lewycky
1d9a8159df
Teach the verifier to check the condition on a branch and ensure that it has
...
'i1' type.
llvm-svn: 96282
2010-02-15 22:09:09 +00:00
Nick Lewycky
62f864dea3
Fix crash in VerifyType when checking Contexts. Because there may not be a
...
Module (we were called with verifyFunction and an unowned Function) we can't
rely on Mod->getContext().
llvm-svn: 96275
2010-02-15 21:52:04 +00:00
Nick Lewycky
94e168f09e
Don't try to materialize a function that isn't materializable anyways. This
...
fixes a crash using FPM on a Function that isn't owned by a Module.
llvm-svn: 96273
2010-02-15 21:27:56 +00:00
Nick Lewycky
780d2fe319
A function with no Module owner isn't materializable. This fixes F->dump() for
...
functions not embedded within modules.
llvm-svn: 96272
2010-02-15 21:27:20 +00:00
Duncan Sands
9dff9bec31
Uniformize the names of type predicates: rather than having isFloatTy and
...
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Jeffrey Yasskin
01f88a96c5
Make PassRegistrar thread-safe since it can be modified by code running in
...
separate LLVMContexts.
llvm-svn: 96051
2010-02-13 00:03:17 +00:00
Chris Lattner
392be58cad
Add support for a union type in LLVM IR. Patch by Talin!
...
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Charles Davis
be5557e86b
Add a new function attribute, 'alignstack'. It will indicate (when the backends
...
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).
llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Devang Patel
c07f1f4f7b
revert 95903.
...
llvm-svn: 95918
2010-02-11 20:58:56 +00:00
Devang Patel
11ddc679ca
Destroy MDNodes while destructing llvm context.
...
llvm-svn: 95903
2010-02-11 19:35:10 +00:00
Jeffrey Yasskin
c660b23075
Fix some of the memcheck errors found in the JIT unittests.
...
llvm-svn: 95856
2010-02-11 06:41:30 +00:00
Dan Gohman
bd11c41b91
Minor whitespace cleanups.
...
llvm-svn: 95801
2010-02-10 20:42:57 +00:00
Dan Gohman
e34890f921
Add a hook to AssemblyAnnotationWriter to allow custom info comments
...
to be printed, in place of the familiar "uses=" comments.
llvm-svn: 95798
2010-02-10 20:41:46 +00:00
Dan Gohman
97c5902e78
Fix several comments which had previously been "the the" where a
...
different word was intended.
llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
4a618827de
Fix "the the" and similar typos.
...
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Dan Gohman
183a423af9
Canonicalize sizeof and alignof on pointer types to a canonical
...
pointer type.
llvm-svn: 95769
2010-02-10 06:13:07 +00:00
Kenneth Uildriks
08f618cd03
IntegerValType holds a uint32_t, so its constructor should take a uint32_t. This allows it to be properly initialized with bit widths > 65535
...
llvm-svn: 95731
2010-02-10 00:14:03 +00:00
Nick Lewycky
b1d5ead9fb
Make the destructor for TypeMapBase protected. Spotted by Duncan Sands with
...
cppcheck!
llvm-svn: 95527
2010-02-07 21:13:46 +00:00
Jakob Stoklund Olesen
74bb06c0f0
Reintroduce the InlineHint function attribute.
...
This time it's for real! I am going to hook this up in the frontends as well.
The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.
We need some experiments to determine if that is the right thing to do.
llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Duncan Sands
fa5f5965de
Adding missing methods for creating Add, Mul, Neg and Sub with NUW.
...
llvm-svn: 95086
2010-02-02 12:53:04 +00:00
Dan Gohman
f644af8bbe
Factor out alignof expression folding into a separate function and
...
generalize it to handle more cases.
llvm-svn: 95045
2010-02-02 01:41:39 +00:00
Chris Lattner
f5edeebd8c
eliminate a bunch of pointless LLVMContext arguments.
...
llvm-svn: 95001
2010-02-01 20:48:08 +00:00
Duncan Sands
dddba06e9e
Fix typo "of" -> "or" and change the way a line was formatted to fit
...
into 80 columns to match my artistic preferences.
llvm-svn: 95000
2010-02-01 20:42:02 +00:00
Chris Lattner
94eb4b285b
fix PR6195, a bug constant folding scalar -> vector compares.
...
llvm-svn: 94997
2010-02-01 20:04:40 +00:00
Chris Lattner
3c46e14137
fix PR6197 - infinite recursion in ipsccp due to block addresses
...
evaluateICmpRelation wasn't handling blockaddress.
llvm-svn: 94993
2010-02-01 19:35:08 +00:00
Dan Gohman
e5e1b7b05a
Generalize target-independent folding rules for sizeof to handle more
...
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.
Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.
Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.
And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.
llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Dan Gohman
de047f2051
Add a getNUWMul function.
...
llvm-svn: 94982
2010-02-01 16:38:14 +00:00
Dan Gohman
ede94e6850
Add a generalized form of ConstantExpr::getOffsetOf which works for
...
array types as well as struct types, and which accepts arbitrary
Constant indicies.
llvm-svn: 94981
2010-02-01 16:37:38 +00:00
Dan Gohman
5ded1424b0
Print a comment next to "materializable" global values, to distinguish
...
them from values that are not actually defined in the module.
llvm-svn: 94854
2010-01-29 23:12:36 +00:00
Benjamin Kramer
b17c58674e
Convert some users of ftostr to raw_ostream.
...
llvm-svn: 94808
2010-01-29 14:42:22 +00:00
Dan Gohman
a424b9fbd1
Remove the folding rule
...
getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
to
inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).
The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.
Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.
llvm-svn: 94750
2010-01-28 18:08:26 +00:00
Dan Gohman
a9be73929f
Make getAlignOf return an i64, for consistency with getSizeOf and
...
getOffsetOf, and remove the comment about assuming i8 is byte-aligned,
which is no longer applicable.
llvm-svn: 94738
2010-01-28 02:43:22 +00:00
Dan Gohman
cf9138307d
Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
...
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.
Also add code for pattern-matching these expressions, for clients that
want to recognize them.
Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.
llvm-svn: 94737
2010-01-28 02:15:55 +00:00
Ted Kremenek
8fafa93092
Update CMake build.
...
llvm-svn: 94687
2010-01-27 20:44:12 +00:00