opencl/llvm.git
13 years agoCMake: Added notes pointing to the LLVM CMake documentation.
Oscar Fuentes [Sat, 4 Apr 2009 22:52:02 +0000 (22:52 +0000)]
CMake: Added notes pointing to the LLVM CMake documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68429 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: defines and uses macro add_llvm_definitions for keeping track
Oscar Fuentes [Sat, 4 Apr 2009 22:41:07 +0000 (22:41 +0000)]
CMake: defines and uses macro add_llvm_definitions for keeping track
of compiler parameters explicitly added by the build
specification. This macro replaces the cmake built-in
`add_definitions'.

Detects glibc and defines _GNU_SOURCE accordingly.

Resolves bug 3882.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68428 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix some HTML validation errors.
Bill Wendling [Sat, 4 Apr 2009 22:36:02 +0000 (22:36 +0000)]
Fix some HTML validation errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68427 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneral clean-up of the bitcode format documentation. Having the paragraphs
Bill Wendling [Sat, 4 Apr 2009 22:27:03 +0000 (22:27 +0000)]
General clean-up of the bitcode format documentation. Having the paragraphs
formatted the same, putting words in <tt> tags, adding &mdash;s, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68426 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry SSE2?
Nick Lewycky [Sat, 4 Apr 2009 10:24:24 +0000 (10:24 +0000)]
Try SSE2?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68423 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCloneModule stores the BasicBlock mapping in ValueMap. There's no need to
Nick Lewycky [Sat, 4 Apr 2009 09:39:23 +0000 (09:39 +0000)]
CloneModule stores the BasicBlock mapping in ValueMap. There's no need to
recompute it. This fixes a O(n^2) in number of blocks when reducing a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68422 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove bogus include.
Nick Lewycky [Sat, 4 Apr 2009 07:42:46 +0000 (07:42 +0000)]
Remove bogus include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68421 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for embedded metadata to LLVM. This introduces two new types of
Nick Lewycky [Sat, 4 Apr 2009 07:22:01 +0000 (07:22 +0000)]
Add support for embedded metadata to LLVM. This introduces two new types of
Constant, MDString and MDNode which can only be used by globals with a name
that starts with "llvm." or as arguments to a function with the same naming
restriction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68420 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix test on non-x86 platforms.
Nick Lewycky [Sat, 4 Apr 2009 07:20:43 +0000 (07:20 +0000)]
Fix test on non-x86 platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68419 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTest commit access to LLVM with some minor narcissism.
Stefanus Du Toit [Fri, 3 Apr 2009 21:41:52 +0000 (21:41 +0000)]
Test commit access to LLVM with some minor narcissism.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68408 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWrap some lines to fix indentation problems.
Bob Wilson [Fri, 3 Apr 2009 21:08:42 +0000 (21:08 +0000)]
Wrap some lines to fix indentation problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68405 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix some comments.
Bob Wilson [Fri, 3 Apr 2009 20:53:25 +0000 (20:53 +0000)]
Fix some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68404 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDuplicate entry.
Bill Wendling [Fri, 3 Apr 2009 20:32:13 +0000 (20:32 +0000)]
Duplicate entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68401 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago"This adds a getName() method to TargetRegisterClass, just like in TargetRegisterInfo.
Chris Lattner [Fri, 3 Apr 2009 20:25:41 +0000 (20:25 +0000)]
"This adds a getName() method to TargetRegisterClass, just like in TargetRegisterInfo.
This makes debugging register classes a bit easier."

Patch by Jakob Stoklund Olesen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68400 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago"Add documentation about the fix for missing x86
Chris Lattner [Fri, 3 Apr 2009 20:23:52 +0000 (20:23 +0000)]
"Add documentation about the fix for missing x86
target library in windows under the "Common problems" section."

Patch by Stefanus Du Toit!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68399 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a TargetLowering optimization so that it doesn't duplicate
Dan Gohman [Fri, 3 Apr 2009 20:11:30 +0000 (20:11 +0000)]
Fix a TargetLowering optimization so that it doesn't duplicate
loads when an input node has multiple uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68398 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd fast path for raw_ostream output of strings.
Daniel Dunbar [Fri, 3 Apr 2009 18:43:17 +0000 (18:43 +0000)]
Add fast path for raw_ostream output of strings.
 - Particularly nice for small constant strings, which get optimized
   down nicely. On a synthetic benchmark writing out "hello" in a
   loop, this is about 2x faster with gcc and 3x faster with
   llvm-gcc. llc on insn-attrtab.bc from 403.gcc is about .5% faster.

 - I tried for a fancier solution which wouldn't increase code size as
   much (by trying to match constant arrays), but can't quite make it
   fly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68396 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: tools/llvm-config/CMakeLists.txt: Use ! instead of comma as
Oscar Fuentes [Fri, 3 Apr 2009 12:16:32 +0000 (12:16 +0000)]
CMake: tools/llvm-config/CMakeLists.txt: Use ! instead of comma as
separator in sed scripts. Resolves Bug 3881.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68385 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: removed IA64AsmPrinter.cpp from lib/Target/IA64/CMakeLists.txt
Oscar Fuentes [Fri, 3 Apr 2009 12:11:43 +0000 (12:11 +0000)]
CMake: removed IA64AsmPrinter.cpp from lib/Target/IA64/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68384 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSeparate MIPS asmprinter
Anton Korobeynikov [Fri, 3 Apr 2009 10:41:41 +0000 (10:41 +0000)]
Separate MIPS asmprinter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68383 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix target library name
Anton Korobeynikov [Fri, 3 Apr 2009 10:41:17 +0000 (10:41 +0000)]
Fix target library name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68382 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comment
Anton Korobeynikov [Fri, 3 Apr 2009 10:41:00 +0000 (10:41 +0000)]
Fix comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68381 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove IA64 asmprinter to separate library
Anton Korobeynikov [Fri, 3 Apr 2009 10:38:51 +0000 (10:38 +0000)]
Move IA64 asmprinter to separate library

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68380 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded a x86 dag combine to increase the chances to use a
Mon P Wang [Fri, 3 Apr 2009 02:43:30 +0000 (02:43 +0000)]
Added a x86 dag combine to increase the chances to use a
movq for v2i64 on x86-32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68368 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoupdate some syntax
Chris Lattner [Fri, 3 Apr 2009 00:29:19 +0000 (00:29 +0000)]
update some syntax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68362 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWork around an apparent GCC miscompilation by specializing different,
Chris Lattner [Fri, 3 Apr 2009 00:26:01 +0000 (00:26 +0000)]
Work around an apparent GCC miscompilation by specializing different,
this fixes a regression on some compilers from r68147.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68356 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.
Dan Gohman [Fri, 3 Apr 2009 00:25:26 +0000 (00:25 +0000)]
Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.
Note that these are distinct from TargetInstrInfo::INSERT_SUBREG
and TargetInstrInfo::EXTRACT_SUBREG, which are used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68355 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agocorrect patch
Chris Lattner [Fri, 3 Apr 2009 00:10:56 +0000 (00:10 +0000)]
correct patch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68353 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd patch to go along with r68350
Chris Lattner [Fri, 3 Apr 2009 00:10:31 +0000 (00:10 +0000)]
add patch to go along with r68350

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68352 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agouse higher level APIs.
Chris Lattner [Fri, 3 Apr 2009 00:02:39 +0000 (00:02 +0000)]
use higher level APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68351 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd missing *
Chris Lattner [Thu, 2 Apr 2009 23:53:03 +0000 (23:53 +0000)]
add missing *

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68350 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed build warnings.
Sanjiv Gupta [Thu, 2 Apr 2009 18:33:12 +0000 (18:33 +0000)]
Fixed build warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68333 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTo convert the StopPoint insn into an assembler directive by ISel, we need to have...
Sanjiv Gupta [Thu, 2 Apr 2009 18:03:10 +0000 (18:03 +0000)]
To convert the StopPoint insn into an assembler directive by ISel, we need to have access to the line number field. So we convert that info as an operand by custom handling DBG_STOPPOINT in legalize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68329 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParams are not being generated as static globals now. The caller passes them onto...
Sanjiv Gupta [Thu, 2 Apr 2009 17:42:00 +0000 (17:42 +0000)]
Params are not being generated as static globals now. The caller passes them onto the callee's stack directly and the callee loads the argvals from its own stack. Clang generated frameindexes validatd by recalculating the stack as if all frameindexes represent 1-byte slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68327 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix overflow checks in SmallVector:
Chris Lattner [Thu, 2 Apr 2009 03:06:26 +0000 (03:06 +0000)]
fix overflow checks in SmallVector:

"The code was doing "if (End+NumInputs > Capacity) ...". If End is
close to 0xFFFFFFFF and NumInputs is large, it'll overflow, the
condition will come out false, and the vector won't grow to
accommodate the new elements, and the program will crash in memmove."

Patch by Jeffrey Yasskin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68277 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix build on Linux.
Mikhail Glushenkov [Thu, 2 Apr 2009 01:11:37 +0000 (01:11 +0000)]
Fix build on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68269 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReapply r68211, with the miscompilations it caused fixed.
Owen Anderson [Wed, 1 Apr 2009 23:53:49 +0000 (23:53 +0000)]
Reapply r68211, with the miscompilations it caused fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68262 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake the constants fit.
Bill Wendling [Wed, 1 Apr 2009 22:44:18 +0000 (22:44 +0000)]
Make the constants fit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68258 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up pass manager cache after each run.
Devang Patel [Wed, 1 Apr 2009 22:34:41 +0000 (22:34 +0000)]
Clean up pass manager cache after each run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68254 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agosilence warning in release-asserts build.
Chris Lattner [Wed, 1 Apr 2009 22:14:45 +0000 (22:14 +0000)]
silence warning in release-asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68253 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd llvm::Triple class for abstracting access to target triples.
Daniel Dunbar [Wed, 1 Apr 2009 21:53:23 +0000 (21:53 +0000)]
Add llvm::Triple class for abstracting access to target triples.
 - The code is silly, I'm just amusing myself. Rewrite to be efficient
   if you like. :)

Also, if you wish to debate the proper names of the triple components
I'm all ears.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68252 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed file header comment.
Misha Brukman [Wed, 1 Apr 2009 21:37:19 +0000 (21:37 +0000)]
Fixed file header comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68250 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded tests for math utility functions; fixed another test's header comment.
Misha Brukman [Wed, 1 Apr 2009 21:36:40 +0000 (21:36 +0000)]
Added tests for math utility functions; fixed another test's header comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68249 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed spelling.
Misha Brukman [Wed, 1 Apr 2009 21:33:08 +0000 (21:33 +0000)]
Fixed spelling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68248 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove dead code.
Devang Patel [Wed, 1 Apr 2009 21:27:08 +0000 (21:27 +0000)]
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68246 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd this to SVN to allow collaborative hacking.
Chris Lattner [Wed, 1 Apr 2009 21:11:04 +0000 (21:11 +0000)]
add this to SVN to allow collaborative hacking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68243 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd range insert method for DenseSet and define DenseMapInfo for chars.
Chris Lattner [Wed, 1 Apr 2009 19:50:49 +0000 (19:50 +0000)]
Add range insert method for DenseSet and define DenseMapInfo for chars.
Patch by Kevin Fan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68239 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRecognize arm triplets.
Evan Cheng [Wed, 1 Apr 2009 18:54:56 +0000 (18:54 +0000)]
Recognize arm triplets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68229 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse CHAR_BIT instead of hard-coding 8 in several places where it
Dan Gohman [Wed, 1 Apr 2009 18:45:54 +0000 (18:45 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConstify method to make VC++ happy. Patch by Brian Diekelman!
Ted Kremenek [Wed, 1 Apr 2009 18:24:22 +0000 (18:24 +0000)]
Constify method to make VC++ happy.  Patch by Brian Diekelman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68222 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse LLVM type names instead of C type names in comments, to be
Dan Gohman [Wed, 1 Apr 2009 18:10:16 +0000 (18:10 +0000)]
Use LLVM type names instead of C type names in comments, to be
less ambiguous and less C-specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68219 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix PR3862: Recognize some ARM-specific constraints for immediates in inline
Bob Wilson [Wed, 1 Apr 2009 17:58:54 +0000 (17:58 +0000)]
Fix PR3862: Recognize some ARM-specific constraints for immediates in inline
assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68218 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r68172. It caused regressions in
Dan Gohman [Wed, 1 Apr 2009 16:37:47 +0000 (16:37 +0000)]
Revert r68172. It caused regressions in
  Applications/Burg/burg
  Applications/ClamAV/clamscan
and many other tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68211 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed spelling.
Misha Brukman [Wed, 1 Apr 2009 16:13:29 +0000 (16:13 +0000)]
Fixed spelling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68209 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCMake: Have generated Xcode projects also contain the LLVM header files.
Ted Kremenek [Wed, 1 Apr 2009 15:40:21 +0000 (15:40 +0000)]
CMake: Have generated Xcode projects also contain the LLVM header files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68206 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDetect that we're building from a git checkout like we do for cvs and svn.
Nick Lewycky [Wed, 1 Apr 2009 04:39:25 +0000 (04:39 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68187 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agohopefully fix an apparent build error on windows.
Chris Lattner [Wed, 1 Apr 2009 02:03:38 +0000 (02:03 +0000)]
hopefully fix an apparent build error on windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68175 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix a serious regression I introduced in my previous patch.
Chris Lattner [Wed, 1 Apr 2009 01:43:03 +0000 (01:43 +0000)]
fix a serious regression I introduced in my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68173 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance GVN to propagate simple conditionals. This fixes PR3921.
Owen Anderson [Wed, 1 Apr 2009 01:20:45 +0000 (01:20 +0000)]
Enhance GVN to propagate simple conditionals.  This fixes PR3921.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68172 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoinclude Makefile.common before using $(BuildMode) to get its definition
Misha Brukman [Wed, 1 Apr 2009 00:35:00 +0000 (00:35 +0000)]
include Makefile.common before using $(BuildMode) to get its definition

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68167 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago* Fixed spelling of `invertible'
Misha Brukman [Wed, 1 Apr 2009 00:15:46 +0000 (00:15 +0000)]
* Fixed spelling of `invertible'
* Simplified if statement

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68163 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAllow the use of pointers to const within PointerUnion.
Douglas Gregor [Tue, 31 Mar 2009 23:19:54 +0000 (23:19 +0000)]
Allow the use of pointers to const within PointerUnion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68159 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a converting operator
Chris Lattner [Tue, 31 Mar 2009 23:09:51 +0000 (23:09 +0000)]
add a converting operator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68158 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoreimplement BitcodeReaderValueList in terms of WeakVH instead of making
Chris Lattner [Tue, 31 Mar 2009 22:55:09 +0000 (22:55 +0000)]
reimplement BitcodeReaderValueList in terms of WeakVH instead of making
it be an LLVM IR User object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68156 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake the key of ValueRankMap an AssertingVH, so that we die violently
Chris Lattner [Tue, 31 Mar 2009 22:13:29 +0000 (22:13 +0000)]
Make the key of ValueRankMap an AssertingVH, so that we die violently
if it dangles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68150 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd two new classes: WeakVH and AssertingVH. These are both "ValueHandles",
Chris Lattner [Tue, 31 Mar 2009 22:11:05 +0000 (22:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68149 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoteach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
Chris Lattner [Tue, 31 Mar 2009 21:28:39 +0000 (21:28 +0000)]
teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68147 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd some accessors so I can play games with DenseMaps.
Chris Lattner [Tue, 31 Mar 2009 20:57:23 +0000 (20:57 +0000)]
add some accessors so I can play games with DenseMaps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68145 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThrottle back "fold select into operand" transformation. InstCombine should not gener...
Evan Cheng [Tue, 31 Mar 2009 20:42:45 +0000 (20:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68142 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFully general expansion of integer shift of any size.
Evan Cheng [Tue, 31 Mar 2009 19:39:24 +0000 (19:39 +0000)]
Fully general expansion of integer shift of any size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68134 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoi128 shift libcalls are not available on x86.
Evan Cheng [Tue, 31 Mar 2009 19:38:51 +0000 (19:38 +0000)]
i128 shift libcalls are not available on x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68133 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReapply 68073, with fixes. EH Landing-pad basic blocks are not
Dan Gohman [Tue, 31 Mar 2009 18:39:13 +0000 (18:39 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68129 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo not pass '-relocation-model=pic' to llc.
Mikhail Glushenkov [Tue, 31 Mar 2009 18:33:54 +0000 (18:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68127 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStop guessing, start thinking, and make PointerUnion3::is actually be correct.
Douglas Gregor [Tue, 31 Mar 2009 18:31:03 +0000 (18:31 +0000)]
Stop guessing, start thinking, and make PointerUnion3::is actually be correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68126 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd an explicit -asm-verbose to these tests, to make it
Dan Gohman [Tue, 31 Mar 2009 18:20:47 +0000 (18:20 +0000)]
Add an explicit -asm-verbose to these tests, to make it
possible to run the tests with -asm-verbose defaulting
to false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68124 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate call graph after inlining invoke.
Devang Patel [Tue, 31 Mar 2009 17:36:12 +0000 (17:36 +0000)]
Update call graph after inlining invoke.
Patch by Jay Foad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68120 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd llvm::sys::getHostTriple and remove
Daniel Dunbar [Tue, 31 Mar 2009 17:30:15 +0000 (17:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68118 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMinor top-level comment fix.
Dan Gohman [Tue, 31 Mar 2009 16:51:18 +0000 (16:51 +0000)]
Minor top-level comment fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68113 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up some comments.
Dan Gohman [Tue, 31 Mar 2009 16:48:35 +0000 (16:48 +0000)]
Tidy up some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68112 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a comment.
Dan Gohman [Tue, 31 Mar 2009 16:46:45 +0000 (16:46 +0000)]
Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68111 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoremove unused arguments.
Rafael Espindola [Tue, 31 Mar 2009 16:16:57 +0000 (16:16 +0000)]
remove unused arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68109 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReally temporarily revert r68073.
Bill Wendling [Tue, 31 Mar 2009 08:42:40 +0000 (08:42 +0000)]
Really temporarily revert r68073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68100 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOy! When reverting r68073, I added in experimental code. Sorry...
Bill Wendling [Tue, 31 Mar 2009 08:41:31 +0000 (08:41 +0000)]
Oy! When reverting r68073, I added in experimental code. Sorry...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68099 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the "fast" cases for spill and restore point determination, as these were...
Owen Anderson [Tue, 31 Mar 2009 08:27:09 +0000 (08:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68093 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r68073. It's causing a failure in the Apple-style builds.
Bill Wendling [Tue, 31 Mar 2009 08:26:26 +0000 (08:26 +0000)]
Revert r68073. It's causing a failure in the Apple-style builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68092 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoshrink subclassid, liberating some bits for future (ab)use.
Chris Lattner [Tue, 31 Mar 2009 07:25:22 +0000 (07:25 +0000)]
shrink subclassid, liberating some bits for future (ab)use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68087 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix live-out reg logic to not insert over-aggressive AssertZExt
Dan Gohman [Tue, 31 Mar 2009 01:38:29 +0000 (01:38 +0000)]
Fix live-out reg logic to not insert over-aggressive AssertZExt
instructions. This fixes lua.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68083 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoX86 address mode isel tweak. If the base of the address is also used by a CopyToReg...
Evan Cheng [Tue, 31 Mar 2009 01:13:53 +0000 (01:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68082 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReally, really fix PointerUnion3::is
Douglas Gregor [Tue, 31 Mar 2009 00:34:31 +0000 (00:34 +0000)]
Really, really fix PointerUnion3::is

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68079 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExcept in asm-verbose mode, avoid printing labels for blocks that are
Dan Gohman [Mon, 30 Mar 2009 22:55:17 +0000 (22:55 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68073 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLoop Index Split can eliminate a loop if it can determin if loop body is executed...
Devang Patel [Mon, 30 Mar 2009 22:24:10 +0000 (22:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68071 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake PointerUnion3::get work properly
Douglas Gregor [Mon, 30 Mar 2009 21:44:13 +0000 (21:44 +0000)]
Make PointerUnion3::get work properly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68067 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen optimzing a mul by immediate into two, the resulting mul's should get a x86...
Evan Cheng [Mon, 30 Mar 2009 21:36:47 +0000 (21:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68066 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTurn a 2-address instruction into a 3-address one when it's profitable even if the...
Evan Cheng [Mon, 30 Mar 2009 21:34:07 +0000 (21:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68065 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoupdate comment.
Chris Lattner [Mon, 30 Mar 2009 20:44:04 +0000 (20:44 +0000)]
update comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68060 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBalance out quote in debug output.
Bill Wendling [Mon, 30 Mar 2009 20:32:22 +0000 (20:32 +0000)]
Balance out quote in debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68059 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix grammar-o in comment.
Bill Wendling [Mon, 30 Mar 2009 20:30:02 +0000 (20:30 +0000)]
Fix grammar-o in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68057 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd a PointerUnion3 class and generalize PointerUnion to work with
Chris Lattner [Mon, 30 Mar 2009 20:29:27 +0000 (20:29 +0000)]
add a PointerUnion3 class and generalize PointerUnion to work with
anything pointer-like, which may or may not actually be a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68056 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix the PointerLikeTypeTraits specialization for PointerIntPair to
Chris Lattner [Mon, 30 Mar 2009 20:28:50 +0000 (20:28 +0000)]
fix the PointerLikeTypeTraits specialization for PointerIntPair to
allow the traits to be specified as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68055 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConstify arguments in isSuccessor and isLayoutSuccessor.
Dan Gohman [Mon, 30 Mar 2009 20:06:29 +0000 (20:06 +0000)]
Constify arguments in isSuccessor and isLayoutSuccessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68054 91177308-0d34-0410-b5e6-96231b3b80d8