Devang Patel
e2ff483afd
Remove dead code.
...
llvm-svn: 68246
2009-04-01 21:27:08 +00:00
Chris Lattner
d978cc5c63
add this to SVN to allow collaborative hacking.
...
llvm-svn: 68243
2009-04-01 21:11:04 +00:00
Chris Lattner
807a0f207d
Add range insert method for DenseSet and define DenseMapInfo for chars.
...
Patch by Kevin Fan!
llvm-svn: 68239
2009-04-01 19:50:49 +00:00
Evan Cheng
856e339241
Recognize arm triplets.
...
llvm-svn: 68229
2009-04-01 18:54:56 +00:00
Dan Gohman
cff6953c45
Use CHAR_BIT instead of hard-coding 8 in several places where it
...
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.
llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Ted Kremenek
061cf25072
Constify method to make VC++ happy. Patch by Brian Diekelman!
...
llvm-svn: 68222
2009-04-01 18:24:22 +00:00
Dan Gohman
0170402fe8
Use LLVM type names instead of C type names in comments, to be
...
less ambiguous and less C-specific.
llvm-svn: 68219
2009-04-01 18:10:16 +00:00
Bob Wilson
cf1ec2cc68
Fix PR3862: Recognize some ARM-specific constraints for immediates in inline
...
assembly.
llvm-svn: 68218
2009-04-01 17:58:54 +00:00
Dan Gohman
c4971721ea
Revert r68172. It caused regressions in
...
Applications/Burg/burg
Applications/ClamAV/clamscan
and many other tests.
llvm-svn: 68211
2009-04-01 16:37:47 +00:00
Misha Brukman
23fe17f55b
Fixed spelling.
...
llvm-svn: 68209
2009-04-01 16:13:29 +00:00
Ted Kremenek
d28577651e
CMake: Have generated Xcode projects also contain the LLVM header files.
...
llvm-svn: 68206
2009-04-01 15:40:21 +00:00
Nick Lewycky
9a196c0119
Detect that we're building from a git checkout like we do for cvs and svn.
...
Based on a patch by Nicolas Trangez on the unladen-swallow mailing list!
llvm-svn: 68187
2009-04-01 04:39:25 +00:00
Chris Lattner
7e06443d44
hopefully fix an apparent build error on windows.
...
llvm-svn: 68175
2009-04-01 02:03:38 +00:00
Chris Lattner
647cffba61
fix a serious regression I introduced in my previous patch.
...
llvm-svn: 68173
2009-04-01 01:43:03 +00:00
Owen Anderson
ff5961b46c
Enhance GVN to propagate simple conditionals. This fixes PR3921.
...
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
Misha Brukman
7f1f0b03e2
include Makefile.common before using $(BuildMode) to get its definition
...
llvm-svn: 68167
2009-04-01 00:35:00 +00:00
Misha Brukman
5fc1a0339c
* Fixed spelling of `invertible'
...
* Simplified if statement
llvm-svn: 68163
2009-04-01 00:15:46 +00:00
Douglas Gregor
a9d1032f9c
Allow the use of pointers to const within PointerUnion.
...
llvm-svn: 68159
2009-03-31 23:19:54 +00:00
Chris Lattner
169b2f191d
add a converting operator
...
llvm-svn: 68158
2009-03-31 23:09:51 +00:00
Chris Lattner
2d8cd80ee0
reimplement BitcodeReaderValueList in terms of WeakVH instead of making
...
it be an LLVM IR User object.
llvm-svn: 68156
2009-03-31 22:55:09 +00:00
Chris Lattner
f72ce6ea8b
Make the key of ValueRankMap an AssertingVH, so that we die violently
...
if it dangles.
llvm-svn: 68150
2009-03-31 22:13:29 +00:00
Chris Lattner
90234f34c6
Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles",
...
which are effectively smart pointers to Value*'s. They are both very light
weight and simple, and react to values being destroyed or being RAUW'd.
WeakVN does a best effort to follow a value around, including through RAUW
operations and will get nulled out of the value is destroyed. This is useful
for the eventual "metadata that references a value" work, because it is a
reference to a value that does not show up on its use_* list.
AssertingVH is a pointer that compiles down to a dumb raw pointer when
assertions are disabled. When enabled, it emits an assertion if the
pointed-to value is destroyed while it is still being referenced. This
is very useful for Maps and other things, and should have caught the recent
bugs in CallGraph and Reassociate, for example.
llvm-svn: 68149
2009-03-31 22:11:05 +00:00
Chris Lattner
e756f15703
teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
...
llvm-svn: 68147
2009-03-31 21:28:39 +00:00
Chris Lattner
e0d25e42e9
add some accessors so I can play games with DenseMaps.
...
llvm-svn: 68145
2009-03-31 20:57:23 +00:00
Evan Cheng
826b6f0f7c
Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
...
e.g.
define i32 @t1(i32 %c, i32 %x) nounwind {
%t1 = icmp eq i32 %c, 0
%t2 = lshr i32 %x, 18
%t3 = select i1 %t1, i32 %t2, i32 %x
ret i32 %t3
}
was turned into
define i32 @t2(i32 %c, i32 %x) nounwind {
%t1 = icmp eq i32 %c, 0
%t2 = select i1 %t1, i32 18, i32 0
%t3 = lshr i32 %x, %t2
ret i32 %t3
}
For most targets, that means materializing two constants and then a select. e.g. On x86-64
movl %esi, %eax
shrl $18, %eax
testl %edi, %edi
cmovne %esi, %eax
ret
=>
xorl %eax, %eax
testl %edi, %edi
movl $18, %ecx
cmovne %eax, %ecx
movl %esi, %eax
shrl %cl, %eax
ret
Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.
llvm-svn: 68142
2009-03-31 20:42:45 +00:00
Evan Cheng
0d551591ea
Fully general expansion of integer shift of any size.
...
llvm-svn: 68134
2009-03-31 19:39:24 +00:00
Evan Cheng
d9d6e427d6
i128 shift libcalls are not available on x86.
...
llvm-svn: 68133
2009-03-31 19:38:51 +00:00
Dan Gohman
6b42dfddf4
Reapply 68073, with fixes. EH Landing-pad basic blocks are not
...
entered via fall-through. Don't miss fallthroughs from blocks
terminated by conditional branches. Also, move
isOnlyReachableByFallthrough out of line.
llvm-svn: 68129
2009-03-31 18:39:13 +00:00
Mikhail Glushenkov
eccc5967bf
Do not pass '-relocation-model=pic' to llc.
...
Does not work well on 32 bit targets. Bug reported by Albert Graef.
This patch also adds new "-Wllc,option" syntax to pass options to llc.
llvm-svn: 68127
2009-03-31 18:33:54 +00:00
Douglas Gregor
1d249d984c
Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
...
llvm-svn: 68126
2009-03-31 18:31:03 +00:00
Dan Gohman
6161b3ccf6
Add an explicit -asm-verbose to these tests, to make it
...
possible to run the tests with -asm-verbose defaulting
to false.
llvm-svn: 68124
2009-03-31 18:20:47 +00:00
Devang Patel
4ce6e69022
Update call graph after inlining invoke.
...
Patch by Jay Foad.
llvm-svn: 68120
2009-03-31 17:36:12 +00:00
Daniel Dunbar
fb1a6eb69b
Add llvm::sys::getHostTriple and remove
...
llvm::sys::getOS{Name,Version}.
Right now the implementation just derives from LLVM_HOSTTRIPLE (which
is wrong, but it doesn't look like we have a define for the target
triple). Ideally this routine would actually be able to compute the
triple for targets we care about.
llvm-svn: 68118
2009-03-31 17:30:15 +00:00
Dan Gohman
d51f196ff5
Minor top-level comment fix.
...
llvm-svn: 68113
2009-03-31 16:51:18 +00:00
Dan Gohman
90ea62cba6
Tidy up some comments.
...
llvm-svn: 68112
2009-03-31 16:48:35 +00:00
Dan Gohman
0837aa99ea
Add a comment.
...
llvm-svn: 68111
2009-03-31 16:46:45 +00:00
Rafael Espindola
9277379fc0
remove unused arguments.
...
llvm-svn: 68109
2009-03-31 16:16:57 +00:00
Bill Wendling
6afae239c2
Really temporarily revert r68073.
...
llvm-svn: 68100
2009-03-31 08:42:40 +00:00
Bill Wendling
b8017e02ca
Oy! When reverting r68073, I added in experimental code. Sorry...
...
llvm-svn: 68099
2009-03-31 08:41:31 +00:00
Owen Anderson
4486c1fac0
Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
...
to account for this change.
llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Bill Wendling
c4b08e5eb0
Revert r68073. It's causing a failure in the Apple-style builds.
...
llvm-svn: 68092
2009-03-31 08:26:26 +00:00
Chris Lattner
42bae59678
shrink subclassid, liberating some bits for future (ab)use.
...
llvm-svn: 68087
2009-03-31 07:25:22 +00:00
Dan Gohman
97a20b8dbf
Fix live-out reg logic to not insert over-aggressive AssertZExt
...
instructions. This fixes lua.
llvm-svn: 68083
2009-03-31 01:38:29 +00:00
Evan Cheng
885bc6de52
X86 address mode isel tweak. If the base of the address is also used by a CopyToReg (i.e. it's likely live-out), do not fold the sub-expressions into the addressing mode to avoid computing the address twice. The CopyToReg use will be isel'ed to a LEA, re-use it for address instead.
...
This is not yet enabled.
llvm-svn: 68082
2009-03-31 01:13:53 +00:00
Douglas Gregor
b874bd9f41
Really, really fix PointerUnion3::is
...
llvm-svn: 68079
2009-03-31 00:34:31 +00:00
Dan Gohman
adccd30533
Except in asm-verbose mode, avoid printing labels for blocks that are
...
only reachable via fall-through edges. This dramatically reduces the
number of labels printed, and thus also the number of labels the
assembler must parse and remember.
llvm-svn: 68073
2009-03-30 22:55:17 +00:00
Devang Patel
6e68bd007a
Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it.
...
llvm-svn: 68071
2009-03-30 22:24:10 +00:00
Douglas Gregor
d33a33cedb
Make PointerUnion3::get work properly
...
llvm-svn: 68067
2009-03-30 21:44:13 +00:00
Evan Cheng
a84a318873
When optimzing a mul by immediate into two, the resulting mul's should get a x86 specific node to avoid dag combiner from hacking on them further.
...
llvm-svn: 68066
2009-03-30 21:36:47 +00:00
Evan Cheng
09f5be8146
Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
...
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0 = MOV %reg1025
If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.
llvm-svn: 68065
2009-03-30 21:34:07 +00:00
Chris Lattner
32f4959ee4
update comment.
...
llvm-svn: 68060
2009-03-30 20:44:04 +00:00
Bill Wendling
2f52e6488f
Balance out quote in debug output.
...
llvm-svn: 68059
2009-03-30 20:32:22 +00:00
Bill Wendling
5f0d97c571
Fix grammar-o in comment.
...
llvm-svn: 68057
2009-03-30 20:30:02 +00:00
Chris Lattner
8aa8f5bf6a
add a PointerUnion3 class and generalize PointerUnion to work with
...
anything pointer-like, which may or may not actually be a pointer.
llvm-svn: 68056
2009-03-30 20:29:27 +00:00
Chris Lattner
73acaa8862
fix the PointerLikeTypeTraits specialization for PointerIntPair to
...
allow the traits to be specified as well.
llvm-svn: 68055
2009-03-30 20:28:50 +00:00
Dan Gohman
ff62c62b7c
Constify arguments in isSuccessor and isLayoutSuccessor.
...
llvm-svn: 68054
2009-03-30 20:06:29 +00:00
Dan Gohman
d3899dc52f
Update the polygen grammer to reflect that zext and sext are no longer
...
valid argument attributes (zeroext and signext are).
llvm-svn: 68053
2009-03-30 19:59:02 +00:00
John Mosby
169927e7ef
docs/TestingGuide.html: correction to prev. text (objdir!=srcdir required for running test-suite), removed refs to llvm-test
...
llvm-svn: 68051
2009-03-30 18:56:53 +00:00
Bob Wilson
57178e8822
Fix comment to match function name.
...
llvm-svn: 68050
2009-03-30 18:49:37 +00:00
Devang Patel
7a78f3abd3
getEntryFor() may invalidate DenseMap iterator.
...
Walking an invalidated iterator is not a good idea.
llvm-svn: 68047
2009-03-30 18:34:47 +00:00
Mike Stump
9d98cc6b93
Add ccc back for now.
...
llvm-svn: 68038
2009-03-30 17:43:04 +00:00
Anton Korobeynikov
1a7432742c
Clearify local/global relocations wording
...
llvm-svn: 68037
2009-03-30 17:38:00 +00:00
Anton Korobeynikov
56709fdffe
Fix thinko: put stuff with both global and local relocations into data.rel{.ro}, not .local
...
llvm-svn: 68036
2009-03-30 17:37:43 +00:00
Anton Korobeynikov
71278a5be8
Tweak test for recent relro stuff
...
llvm-svn: 68035
2009-03-30 15:28:40 +00:00
Anton Korobeynikov
255a3cbfb4
Fix infinite looping
...
llvm-svn: 68034
2009-03-30 15:28:21 +00:00
Anton Korobeynikov
d5e8e93a92
Properly propagate Kind.
...
llvm-svn: 68033
2009-03-30 15:28:00 +00:00
Anton Korobeynikov
7c5f3c40ca
Do not propagate ELF-specific stuff (data.rel) into other targets. This simplifies code and also ensures correctness.
...
llvm-svn: 68032
2009-03-30 15:27:43 +00:00
Anton Korobeynikov
c247fd396c
Add data.rel stuff
...
llvm-svn: 68031
2009-03-30 15:27:03 +00:00
Chris Lattner
a01a563813
fix some validation problems.
...
llvm-svn: 68026
2009-03-30 06:34:59 +00:00
Evan Cheng
471ed6e460
Forgot this test.
...
llvm-svn: 68025
2009-03-30 06:17:34 +00:00
John Mosby
b92a76ff4f
Clarify section on setting up and running test-suite
...
llvm-svn: 68023
2009-03-30 04:37:51 +00:00
Misha Brukman
d326656d9c
Updated the comment for isArithmeticShift() to match reality.
...
llvm-svn: 68016
2009-03-29 20:41:38 +00:00
Bill Wendling
8fde3036bf
Constify check. This fixes PR3900.
...
llvm-svn: 68013
2009-03-29 20:08:56 +00:00
Anton Korobeynikov
f3cf04f900
Testcase for recent ro/relocs stuff
...
llvm-svn: 68008
2009-03-29 17:14:57 +00:00
Anton Korobeynikov
bea241a5f5
IA64 is as weird as Alpha wrt r/o relocs :)
...
llvm-svn: 68007
2009-03-29 17:14:35 +00:00
Anton Korobeynikov
014a86f216
Alpha always requires global relocations to be r/w regardless of PIC.
...
llvm-svn: 68006
2009-03-29 17:14:14 +00:00
Anton Korobeynikov
088ebede53
Honour relocation behaviour stuff for ro objects
...
llvm-svn: 68005
2009-03-29 17:13:49 +00:00
Anton Korobeynikov
7437b59caf
Extend the relocation tracker handler, so we can filter on different 'kinds' of relocations required.
...
llvm-svn: 68004
2009-03-29 17:13:18 +00:00
Duncan Sands
d21581eaa1
Fix PR3899: add support for extracting floats from vectors
...
when using -soft-float.
Based on a patch by Jakob Stoklund Olesen.
llvm-svn: 67996
2009-03-29 13:51:06 +00:00
Chris Lattner
6694cdf215
add missing space.
...
llvm-svn: 67995
2009-03-29 13:26:05 +00:00
Chris Lattner
5b52baeeef
add some comments, add a dyn_cast method.
...
llvm-svn: 67992
2009-03-29 07:03:30 +00:00
Chris Lattner
e50f47971b
When forming sentinels for empty/tombstone, make sure to respect the
...
pointer's expected number of zero low-bits.
This should fix the breakage I introduced recently.
llvm-svn: 67990
2009-03-29 06:33:22 +00:00
Chris Lattner
3a6dc751ac
add helper method.
...
llvm-svn: 67989
2009-03-29 06:32:46 +00:00
Chris Lattner
a9c6de15fb
Add a simple type-safe bit-mangling pointer union class. This allows
...
you to do things like:
/// PointerUnion<int*, float*> P;
/// P = (int*)0;
/// printf("%d %d", P.is<int*>(), P.is<float*>()); // prints "1 0"
/// X = P.get<int*>(); // ok.
/// Y = P.get<float*>(); // runtime assertion failure.
/// Z = P.get<double*>(); // does not compile.
/// P = (float*)0;
/// Y = P.get<float*>(); // ok.
/// X = P.get<int*>(); // runtime assertion failure.
llvm-svn: 67987
2009-03-29 06:06:02 +00:00
Chris Lattner
35c0232cb0
Allow a specific PointerIntPair instance to use a specific Pointer trait:
...
some pointer instances have properties that not all of a type have.
llvm-svn: 67986
2009-03-29 06:02:20 +00:00
Chris Lattner
d4ff5fce81
Add a PointerLikeTypeTraits specialization for uintptr_t
...
llvm-svn: 67985
2009-03-29 06:00:21 +00:00
Chris Lattner
9bb25a192a
Value* only has 2 bits free as well.
...
llvm-svn: 67984
2009-03-29 05:45:43 +00:00
Chris Lattner
eb71b17705
Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
...
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.
Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.
Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits. This should allow things
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool>
because the inner one knows that 2 low bits are free.
llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Chris Lattner
a00f0d7e4c
rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for
...
# low bits free, and move to its own header.
llvm-svn: 67973
2009-03-29 00:39:30 +00:00
Chris Lattner
8eda11bd9d
now that you can put a PointerIntPair in a SmallPtrSet, remove some
...
hackish workarounds from memdep
llvm-svn: 67971
2009-03-29 00:24:04 +00:00
Chris Lattner
dc2999b4df
teach SmallPtrSet that PointerIntPair is "basically a pointer".
...
llvm-svn: 67970
2009-03-29 00:18:42 +00:00
Chris Lattner
356d974a93
add a note
...
llvm-svn: 67953
2009-03-28 19:26:55 +00:00
Rafael Espindola
1f11c3c36f
Use array_lengthof
...
llvm-svn: 67950
2009-03-28 19:02:18 +00:00
Rafael Espindola
6ff3dabbb4
Have only one definition of X86AddrNumOperands.
...
llvm-svn: 67949
2009-03-28 18:55:31 +00:00
Rafael Espindola
c2a17d3022
Make code a bit less brittle by no hardcoding the number
...
of operands in an address in so many places.
llvm-svn: 67945
2009-03-28 17:03:24 +00:00
Arnold Schwaighofer
e622cbf385
Make check in CheckTailCallReturnConstraints for ignorable instructions between
...
a CALL and a RET node more generic. Add a test for tail calls with a void
return.
llvm-svn: 67943
2009-03-28 12:36:29 +00:00
Bill Wendling
c619aaf122
Update the Visual Studio docs. Patch by Stefanus!
...
llvm-svn: 67940
2009-03-28 10:24:15 +00:00
Arnold Schwaighofer
83d5420d02
Enable tail call optimization for functions that return a struct (bug 3664) and for functions that return types that need extending (e.g i1).
...
llvm-svn: 67934
2009-03-28 08:33:27 +00:00
Chris Lattner
0527eda02e
declare everything as class to avoid angering the VC++ gods.
...
llvm-svn: 67931
2009-03-28 07:48:03 +00:00
Chris Lattner
dec48eab86
add a traits class for SmallPtrSet that allows us to stick things that are
...
"basically pointers" into it.
llvm-svn: 67930
2009-03-28 07:44:53 +00:00