Misha Brukman
f4a8fdc064
Added tests for math utility functions; fixed another test's header comment.
...
llvm-svn: 68249
2009-04-01 21:36:40 +00:00
Misha Brukman
5f34850ba4
Fixed spelling.
...
llvm-svn: 68248
2009-04-01 21:33:08 +00:00
Devang Patel
e182bc0c48
Remove dead code.
...
llvm-svn: 68246
2009-04-01 21:27:08 +00:00
Chris Lattner
2475b3316b
add this to SVN to allow collaborative hacking.
...
llvm-svn: 68243
2009-04-01 21:11:04 +00:00
Chris Lattner
d052c5bb9b
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
2e9343d630
Recognize arm triplets.
...
llvm-svn: 68229
2009-04-01 18:54:56 +00:00
Dan Gohman
770f4158e5
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
3ba6a84085
Constify method to make VC++ happy. Patch by Brian Diekelman!
...
llvm-svn: 68222
2009-04-01 18:24:22 +00:00
Dan Gohman
818a08f22e
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
5b42ebe6a9
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
a134448980
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
31c62f9435
Fixed spelling.
...
llvm-svn: 68209
2009-04-01 16:13:29 +00:00
Ted Kremenek
e5641394b7
CMake: Have generated Xcode projects also contain the LLVM header files.
...
llvm-svn: 68206
2009-04-01 15:40:21 +00:00
Nick Lewycky
8751bd79d6
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
437755672d
hopefully fix an apparent build error on windows.
...
llvm-svn: 68175
2009-04-01 02:03:38 +00:00
Chris Lattner
1f4b1f7866
fix a serious regression I introduced in my previous patch.
...
llvm-svn: 68173
2009-04-01 01:43:03 +00:00
Owen Anderson
d7c837bb4b
Enhance GVN to propagate simple conditionals. This fixes PR3921.
...
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
Misha Brukman
a47cb48efd
include Makefile.common before using $(BuildMode) to get its definition
...
llvm-svn: 68167
2009-04-01 00:35:00 +00:00
Misha Brukman
ea884c9e5e
* Fixed spelling of `invertible'
...
* Simplified if statement
llvm-svn: 68163
2009-04-01 00:15:46 +00:00
Douglas Gregor
aaa9263fc6
Allow the use of pointers to const within PointerUnion.
...
llvm-svn: 68159
2009-03-31 23:19:54 +00:00
Chris Lattner
2dd3b48ac1
add a converting operator
...
llvm-svn: 68158
2009-03-31 23:09:51 +00:00
Chris Lattner
000abfca03
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
87466e0995
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
939313c44a
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
982ca20570
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
dd41c286e5
add some accessors so I can play games with DenseMaps.
...
llvm-svn: 68145
2009-03-31 20:57:23 +00:00
Evan Cheng
c419350132
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
0674a512bf
Fully general expansion of integer shift of any size.
...
llvm-svn: 68134
2009-03-31 19:39:24 +00:00
Evan Cheng
44fdb5d570
i128 shift libcalls are not available on x86.
...
llvm-svn: 68133
2009-03-31 19:38:51 +00:00
Dan Gohman
86e4d0130c
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
98603f97fa
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
50b29cfe51
Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
...
llvm-svn: 68126
2009-03-31 18:31:03 +00:00
Dan Gohman
9f7d1f2bd4
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
7fa69ef109
Update call graph after inlining invoke.
...
Patch by Jay Foad.
llvm-svn: 68120
2009-03-31 17:36:12 +00:00
Daniel Dunbar
aec3d9857f
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
5f64e10d8d
Minor top-level comment fix.
...
llvm-svn: 68113
2009-03-31 16:51:18 +00:00
Dan Gohman
9ab58351ba
Tidy up some comments.
...
llvm-svn: 68112
2009-03-31 16:48:35 +00:00
Dan Gohman
ae2ffc985b
Add a comment.
...
llvm-svn: 68111
2009-03-31 16:46:45 +00:00
Rafael Espindola
3d866ac20c
remove unused arguments.
...
llvm-svn: 68109
2009-03-31 16:16:57 +00:00
Bill Wendling
28fad6fcc1
Really temporarily revert r68073.
...
llvm-svn: 68100
2009-03-31 08:42:40 +00:00
Bill Wendling
1c40c8c242
Oy! When reverting r68073, I added in experimental code. Sorry...
...
llvm-svn: 68099
2009-03-31 08:41:31 +00:00
Owen Anderson
59cff6919d
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
4706abded2
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
95a32aa18b
shrink subclassid, liberating some bits for future (ab)use.
...
llvm-svn: 68087
2009-03-31 07:25:22 +00:00
Dan Gohman
cba99ee717
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
5c02e62620
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
41ab75e9ef
Really, really fix PointerUnion3::is
...
llvm-svn: 68079
2009-03-31 00:34:31 +00:00
Dan Gohman
29694088d3
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
ec65625744
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
0beaefea25
Make PointerUnion3::get work properly
...
llvm-svn: 68067
2009-03-30 21:44:13 +00:00