oota-llvm.git
11 years agoMake it possible to switch off solution folders. VS Express does not support
Manuel Klimek [Wed, 9 May 2012 15:10:54 +0000 (15:10 +0000)]
Make it possible to switch off solution folders. VS Express does not support
them, and requires the user to click away one error message per folder on
project load.

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

11 years agoFixed a typo
Filipe Cabecinhas [Wed, 9 May 2012 14:43:50 +0000 (14:43 +0000)]
Fixed a typo

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

11 years agoSupply a C interface to the "LinkModules" method.
Bill Wendling [Wed, 9 May 2012 08:55:40 +0000 (08:55 +0000)]
Supply a C interface to the "LinkModules" method.
Patch by Andrew Wilkins!

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

11 years agoRemove unused variable to get rid of warning.
Craig Topper [Wed, 9 May 2012 07:08:58 +0000 (07:08 +0000)]
Remove unused variable to get rid of warning.

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

11 years agoAdd another peephole pattern for conditional moves.
Akira Hatanaka [Wed, 9 May 2012 02:29:29 +0000 (02:29 +0000)]
Add another peephole pattern for conditional moves.

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

11 years agoUse ptr_rc_tailcall instead of GR32_TC.
Jakob Stoklund Olesen [Wed, 9 May 2012 01:50:09 +0000 (01:50 +0000)]
Use ptr_rc_tailcall instead of GR32_TC.

The getPointerRegClass() hook will return GR32_TC, or whatever is
appropriate for the current function.

Patch by Yiannis Tsiouris!

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

11 years agoMake register FP allocatable if the compiled function does not have dynamic
Akira Hatanaka [Wed, 9 May 2012 01:38:13 +0000 (01:38 +0000)]
Make register FP allocatable if the compiled function does not have dynamic
allocas.

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

11 years agoExpand 64-bit shifts if target ABI is O32.
Akira Hatanaka [Wed, 9 May 2012 00:55:21 +0000 (00:55 +0000)]
Expand 64-bit shifts if target ABI is O32.

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

11 years agoRemove unused variable to silence compiler warning.
Richard Trieu [Wed, 9 May 2012 00:30:21 +0000 (00:30 +0000)]
Remove unused variable to silence compiler warning.

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

11 years agoDo not install llvm-config-host for cross-builds of clang. rdar://11317847
Bob Wilson [Wed, 9 May 2012 00:07:02 +0000 (00:07 +0000)]
Do not install llvm-config-host for cross-builds of clang. rdar://11317847

My previous change to install llvm-config-host for cross-builds resulted
in that file being installed even when the normal llvm-config was not
installed, e.g., when building the install-clang target.  Daniel suggested
this alternative, which solves the immediate problem and also avoids the gunk
in the top-level makefile.

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

11 years agoMiscellaneous accumulated cleanups.
Dan Gohman [Tue, 8 May 2012 23:39:44 +0000 (23:39 +0000)]
Miscellaneous accumulated cleanups.

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

11 years agoFix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.
Kevin Enderby [Tue, 8 May 2012 23:38:45 +0000 (23:38 +0000)]
Fix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.
PR12731.  Patch by Meador Inge!

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

11 years agoadd to 3.1 release notes
Seth Cantrell [Tue, 8 May 2012 23:34:38 +0000 (23:34 +0000)]
add to 3.1 release notes

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

11 years agoFix objc_storeStrong pattern matching to catch a potential use of the
Dan Gohman [Tue, 8 May 2012 23:34:08 +0000 (23:34 +0000)]
Fix objc_storeStrong pattern matching to catch a potential use of the
old value after the store but before it is released.
This fixes rdar:/11116986.

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

11 years agoUse a shared function for a common operation.
Jakob Stoklund Olesen [Tue, 8 May 2012 23:27:30 +0000 (23:27 +0000)]
Use a shared function for a common operation.

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

11 years agoFix thinko in conditional.
Eric Christopher [Tue, 8 May 2012 21:24:39 +0000 (21:24 +0000)]
Fix thinko in conditional.

Part of rdar://11352000 and should bring the buildbots back.

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

11 years agoDAGCombiner should not change the type of an extract_vector index.
Jim Grosbach [Tue, 8 May 2012 20:56:07 +0000 (20:56 +0000)]
DAGCombiner should not change the type of an extract_vector index.

When a combine twiddles an extract_vector, care should be take to preserve
the type of the index operand. No luck extracting a reasonable testcase,
unfortunately.

rdar://11391009

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

11 years agoRemove empty directories.
Daniel Dunbar [Tue, 8 May 2012 20:51:37 +0000 (20:51 +0000)]
Remove empty directories.

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

11 years agoRemove excess semi-colons to quiet warnings.
Eric Christopher [Tue, 8 May 2012 20:45:04 +0000 (20:45 +0000)]
Remove excess semi-colons to quiet warnings.

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

11 years ago[Support] Fix sys::GetRandomNumber() to always use a high quality seed.
Daniel Dunbar [Tue, 8 May 2012 20:38:00 +0000 (20:38 +0000)]
[Support] Fix sys::GetRandomNumber() to always use a high quality seed.

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

11 years agoUpdate load/store instruction patterns in Hexagon V4.
Sirish Pande [Tue, 8 May 2012 19:50:20 +0000 (19:50 +0000)]
Update load/store instruction patterns in Hexagon V4.

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

11 years agoFormatting fixes.
Akira Hatanaka [Tue, 8 May 2012 19:14:42 +0000 (19:14 +0000)]
Formatting fixes.

Patch by Jack Carter.

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

11 years agoDefine mips16 instruction formats.
Akira Hatanaka [Tue, 8 May 2012 19:08:58 +0000 (19:08 +0000)]
Define mips16 instruction formats.

Patch by Reed Kotler.

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

11 years agoHandle OpDeref in case it comes in as a register operand.
Eric Christopher [Tue, 8 May 2012 18:56:00 +0000 (18:56 +0000)]
Handle OpDeref in case it comes in as a register operand.

Part of rdar://11352000

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

11 years agoUpdate comment.
Eric Christopher [Tue, 8 May 2012 18:55:57 +0000 (18:55 +0000)]
Update comment.

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

11 years agoRevert r156393, "[tests] Remove some remaining DejaGNU related cruft.", this
Daniel Dunbar [Tue, 8 May 2012 18:26:07 +0000 (18:26 +0000)]
Revert r156393, "[tests] Remove some remaining DejaGNU related cruft.", this
patch wasn't ready yet.

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

11 years ago[tests] Remove some remaining DejaGNU related cruft.
Daniel Dunbar [Tue, 8 May 2012 18:11:49 +0000 (18:11 +0000)]
[tests] Remove some remaining DejaGNU related cruft.

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

11 years agoAdding -fcolor-diagnostics is causing problem to users that parse the build
Rafael Espindola [Tue, 8 May 2012 18:11:06 +0000 (18:11 +0000)]
Adding -fcolor-diagnostics is causing problem to users that parse the build
output. Peter Collingbourne also reports that it is showing up in
$(llvm-config --cflags).

Revert this for now since I don't know enough cmake to fix it properly.

This reverts commit 18efed7adc79c1970f307bb5b015d199012ba872.

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

11 years agoRegenerate configure.
Daniel Dunbar [Tue, 8 May 2012 17:48:32 +0000 (17:48 +0000)]
Regenerate configure.

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

11 years ago[docs] Remove POD based man page docs (and build system support).
Daniel Dunbar [Tue, 8 May 2012 17:48:21 +0000 (17:48 +0000)]
[docs] Remove POD based man page docs (and build system support).
 - Currently this leaves us with less build system support (e.g., installing man pages) for the docs than is desired. I'm working on fixing this, but it may take a while. If someone finds this particularly egregious let me know and I will prioritize it.

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

11 years agoremove autoupgrade code for old function attributes format.
Nuno Lopes [Tue, 8 May 2012 17:07:35 +0000 (17:07 +0000)]
remove autoupgrade code for old function attributes format.
I still left another fixme regarding alignment, because I'm unsure how to remove that code without breaking things

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

11 years ago[docs] Add support for building man pages using Sphinx.
Daniel Dunbar [Tue, 8 May 2012 16:50:47 +0000 (16:50 +0000)]
[docs] Add support for building man pages using Sphinx.

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

11 years ago[docs] Integrate the command guide into the toctree.
Daniel Dunbar [Tue, 8 May 2012 16:50:43 +0000 (16:50 +0000)]
[docs] Integrate the command guide into the toctree.

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

11 years ago[docs] Add ReST version of all the man pages.
Daniel Dunbar [Tue, 8 May 2012 16:50:35 +0000 (16:50 +0000)]
[docs] Add ReST version of all the man pages.
 - The POD versions are slated for execution, but are still around until
   llvm.org machinery is in place.

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

11 years agoremove TYPE_CODE_FUNCTION_OLD type code. it is no longer in use and it was marked...
Nuno Lopes [Tue, 8 May 2012 16:16:20 +0000 (16:16 +0000)]
remove TYPE_CODE_FUNCTION_OLD type code. it is no longer in use and it was marked for removal in 3.0

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

11 years agos/CSR_Ghc/CSR_NoRegs/
Jakob Stoklund Olesen [Tue, 8 May 2012 15:07:29 +0000 (15:07 +0000)]
s/CSR_Ghc/CSR_NoRegs/

Share the CalleeSavedRegs defs between all calling conventions having no
callee-saved registers.

Patch by Yiannis Tsiouris!

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

11 years agoLit: rewind WinWaitReleased() stuff in TestRunner.
NAKAMURA Takumi [Tue, 8 May 2012 14:31:52 +0000 (14:31 +0000)]
Lit: rewind WinWaitReleased() stuff in TestRunner.

r145222 "lit/TestRunner.py: [Win32] Introduce WinWaitReleased(f), to wait for file handles to be released by children."
r145223 "lit/TestRunner.py: Use RemoveForce()."
r145381 "lit/TestRunner.py: Try to catch ERROR_FILE_NOT_FOUND, too."
r152916 "lit/TestRunner.py: [Win32] Check all opened_files[] released, rather than (obsoleted) written_files[]."
r153172 "lit/TestRunner.py: [Win32] Rework WinWaitReleased() again! "win32file" from Python Win32 Extensions."

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

11 years agoWindows/PathV2.inc: Retry rename() for (maximum) 2 seconds.
NAKAMURA Takumi [Tue, 8 May 2012 14:31:46 +0000 (14:31 +0000)]
Windows/PathV2.inc: Retry rename() for (maximum) 2 seconds.

Files might be opend by system scanners (eg. file indexer, virus scanner, &c).

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

11 years agoCalling ReassociateExpression recursively is extremely dangerous since it will
Duncan Sands [Tue, 8 May 2012 12:16:05 +0000 (12:16 +0000)]
Calling ReassociateExpression recursively is extremely dangerous since it will
replace the operands of expressions with only one use with undef and generate
a new expression for the original without using RAUW to update the original.
Thus any copies of the original expression held in a vector may end up
referring to some bogus value - and using a ValueHandle won't help since there
is no RAUW.  There is already a mechanism for getting the effect of recursion
non-recursively: adding the value to be recursed on to RedoInsts.  But it wasn't
being used systematically.  Have various places where recursion had snuck in at
some point use the RedoInsts mechanism instead.  Fixes PR12169.

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

11 years agoRejected r156374: Ordinary PR1255 patch. Due to clang-x86_64-debian-fnt buildbot...
Stepan Dyatkovskiy [Tue, 8 May 2012 08:33:21 +0000 (08:33 +0000)]
Rejected r156374: Ordinary PR1255 patch. Due to clang-x86_64-debian-fnt buildbot failure.

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

11 years agoRemove 256-bit AVX non-temporal store intrinsics. Similar was previously done for...
Craig Topper [Tue, 8 May 2012 06:58:15 +0000 (06:58 +0000)]
Remove 256-bit AVX non-temporal store intrinsics. Similar was previously done for 128-bit.

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

11 years agoOrdinary patch for PR1255.
Stepan Dyatkovskiy [Tue, 8 May 2012 06:36:08 +0000 (06:36 +0000)]
Ordinary patch for PR1255.
Added new case-ranges orientated methods for adding/removing cases in SwitchInst. After this patch cases will internally representated as ConstantArray-s instead of ConstantInt, externally cases wrapped within the ConstantRangesSet object.
Old methods of SwitchInst are also works well, but marked as deprecated. So on this stage we have no side effects except that I added support for case ranges in BitcodeReader/Writer, of course test for Bitcode is also added. Old "switch" format is also supported.

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

11 years agoAllow NULL LoopPassManager argument in UnrollLoop. PR12734.
Andrew Trick [Tue, 8 May 2012 02:52:09 +0000 (02:52 +0000)]
Allow NULL LoopPassManager argument in UnrollLoop. PR12734.

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

11 years agoExtract methods for joining physregs.
Jakob Stoklund Olesen [Tue, 8 May 2012 00:08:35 +0000 (00:08 +0000)]
Extract methods for joining physregs.

No functional change.

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

11 years agoNaming convention and whitespace. No functional change.
Jakob Stoklund Olesen [Mon, 7 May 2012 23:46:16 +0000 (23:46 +0000)]
Naming convention and whitespace. No functional change.

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

11 years agoCoalesce subreg-subreg copies.
Jakob Stoklund Olesen [Mon, 7 May 2012 22:57:55 +0000 (22:57 +0000)]
Coalesce subreg-subreg copies.

At least some of them:

  %vreg1:sub_16bit = COPY %vreg2:sub_16bit; GR64:%vreg1, GR32: %vreg2

Previously, we couldn't figure out that the above copy could be
eliminated by coalescing %vreg2 with %vreg1:sub_32bit.

The new getCommonSuperRegClass() hook makes it possible.

This is not very useful yet since the unmodified part of the destination
register usually interferes with the source register. The coalescer
needs to understand sub-register interference checking first.

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

11 years agoRemove C Backend from the bugpoint docs
Pete Cooper [Mon, 7 May 2012 22:42:40 +0000 (22:42 +0000)]
Remove C Backend from the bugpoint docs

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

11 years agoAdd an MF argument to TRI::getPointerRegClass() and TII::getRegClass().
Jakob Stoklund Olesen [Mon, 7 May 2012 22:10:26 +0000 (22:10 +0000)]
Add an MF argument to TRI::getPointerRegClass() and TII::getRegClass().

The getPointerRegClass() hook can return register classes that depend on
the calling convention of the current function (ptr_rc_tailcall).

So far, we have been able to infer the calling convention from the
subtarget alone, but as we add support for multiple calling conventions
per target, that no longer works.

Patch by Yiannis Tsiouris!

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

11 years agoFix bug in TRI::getCommonSuperRegClass().
Jakob Stoklund Olesen [Mon, 7 May 2012 21:59:31 +0000 (21:59 +0000)]
Fix bug in TRI::getCommonSuperRegClass().

Test cases for this code are coming. It is not used for anything yet.

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

11 years agoTeach DAG combine to fold x-x to 0.0 when unsafe FP math is enabled.
Owen Anderson [Mon, 7 May 2012 20:51:25 +0000 (20:51 +0000)]
Teach DAG combine to fold x-x to 0.0 when unsafe FP math is enabled.

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

11 years agoTeach reassociate to commute FMul's and FAdd's in order to canonicalize the order...
Owen Anderson [Mon, 7 May 2012 20:47:23 +0000 (20:47 +0000)]
Teach reassociate to commute FMul's and FAdd's in order to canonicalize the order of their operands across instructions.  This allows for greater CSE opportunities.

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

11 years agoMake IntelJITEvents and OProfileJIT as optional libraries and add
Preston Gurd [Mon, 7 May 2012 19:38:40 +0000 (19:38 +0000)]
Make IntelJITEvents and OProfileJIT as optional libraries and add
optional library support to the llvm-build tool:
 - Add new command line parameter to llvm-build: “--enable-optional-libraries”
 - Add handing of new llvm-build library type “OptionalLibrary”
 - Update Cmake and automake build systems to pass correct flags to llvm-build
   based on configuration

Patch by Dan Malea!

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

11 years agoConstify (trivially) ImmutableSet::iterator::getVisitState().
Jordy Rose [Mon, 7 May 2012 19:24:40 +0000 (19:24 +0000)]
Constify (trivially) ImmutableSet::iterator::getVisitState().

This was probably intended all along.

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

11 years agoAdd TRI::getCommonSuperRegClass().
Jakob Stoklund Olesen [Mon, 7 May 2012 19:14:58 +0000 (19:14 +0000)]
Add TRI::getCommonSuperRegClass().

This function is a generalization of getMatchingSuperRegClass() to the
symmetric case where both sides are using a sub-register index. It will
find a super-register class and sub-register indexes that make this
diagram commute:

                                   PreA
                       SuperRC  ---------->  RCA

                          |                   |
                          |                   |
                     PreB |                   | SubA
                          |                   |
                          |                   |
                          V                   V

                         RCB    ----------> SubRC
                                   SubB

This can be used to coalesce copies like:

  %vreg1:sub16 = COPY %vreg2:sub16; GR64:%vreg1, GR32: %vreg2

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

11 years agoFix a regression from r147481. This combine should only happen if there is a
Chad Rosier [Mon, 7 May 2012 18:47:44 +0000 (18:47 +0000)]
Fix a regression from r147481.  This combine should only happen if there is a
single use.
rdar://11360370

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

11 years agoDon't assume size_t is unsigned long long.
Matt Beaumont-Gay [Mon, 7 May 2012 18:12:42 +0000 (18:12 +0000)]
Don't assume size_t is unsigned long long.

Fixes a -Woverflow warning from gcc when building for 32-bit platforms.

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

11 years agoX86: optimization for -(x != 0)
Manman Ren [Mon, 7 May 2012 18:06:23 +0000 (18:06 +0000)]
X86: optimization for -(x != 0)

This patch will optimize -(x != 0) on X86
FROM
cmpl $0x01,%edi
sbbl %eax,%eax
notl %eax
TO
negl %edi
sbbl %eax %eax

In order to generate negl, I added patterns in Target/X86/X86InstrCompiler.td:
def : Pat<(X86sub_flag 0, GR32:$src), (NEG32r GR32:$src)>;

rdar: 10961709

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

11 years agoAdd support for the 'x' constraint.
Eric Christopher [Mon, 7 May 2012 06:25:19 +0000 (06:25 +0000)]
Add support for the 'x' constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'l' constraint.
Eric Christopher [Mon, 7 May 2012 06:25:15 +0000 (06:25 +0000)]
Add support for the 'l' constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'c' constraint.
Eric Christopher [Mon, 7 May 2012 06:25:10 +0000 (06:25 +0000)]
Add support for the 'c' constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'P' constraint.
Eric Christopher [Mon, 7 May 2012 06:25:02 +0000 (06:25 +0000)]
Add support for the 'P' constraint.

Patch by Jack Carter.

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

11 years agoFix trivial typo in llvm_move.
John McCall [Mon, 7 May 2012 06:00:23 +0000 (06:00 +0000)]
Fix trivial typo in llvm_move.

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

11 years agoFix some issues in the f16c instructions.
Craig Topper [Mon, 7 May 2012 06:00:15 +0000 (06:00 +0000)]
Fix some issues in the f16c instructions.

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

11 years agoAdd support for the 'O' constraint.
Eric Christopher [Mon, 7 May 2012 05:46:48 +0000 (05:46 +0000)]
Add support for the 'O' constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'N' inline asm constraint.
Eric Christopher [Mon, 7 May 2012 05:46:43 +0000 (05:46 +0000)]
Add support for the 'N' inline asm constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'L' inline asm constraint.
Eric Christopher [Mon, 7 May 2012 05:46:37 +0000 (05:46 +0000)]
Add support for the 'L' inline asm constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the inline asm constraint 'K'.
Eric Christopher [Mon, 7 May 2012 05:46:29 +0000 (05:46 +0000)]
Add support for the inline asm constraint 'K'.

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

11 years agoAdd SSE4A MOVNTSS/MOVNTSD instructions.
Craig Topper [Mon, 7 May 2012 05:36:19 +0000 (05:36 +0000)]
Add SSE4A MOVNTSS/MOVNTSD instructions.

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

11 years agoSupport the 'J' constraint.
Eric Christopher [Mon, 7 May 2012 03:13:42 +0000 (03:13 +0000)]
Support the 'J' constraint.

Patch by Jack Carter.

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

11 years agoAdd support for the 'I' inline asm constraint. Also add tests
Eric Christopher [Mon, 7 May 2012 03:13:32 +0000 (03:13 +0000)]
Add support for the 'I' inline asm constraint. Also add tests
from the previous 2 patches.

Patch by Jack Carter.

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

11 years agoAllow 64 bit integer values in gpu registers if arch and abi are 64 bit.
Eric Christopher [Mon, 7 May 2012 03:13:22 +0000 (03:13 +0000)]
Allow 64 bit integer values in gpu registers if arch and abi are 64 bit.

Patch by Jack Carter.

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

11 years agoWhen using inline asm constraints representing
Eric Christopher [Mon, 7 May 2012 03:13:16 +0000 (03:13 +0000)]
When using inline asm constraints representing
non-floating point general registers allow 8 and 16-bit
elements.

Patch by Jack Carter.

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

11 years agoTidy up. Whitespace.
Jim Grosbach [Mon, 7 May 2012 02:25:53 +0000 (02:25 +0000)]
Tidy up. Whitespace.

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

11 years agoUse MVT instead of EVT as the argument to all the shuffle decode functions. Simplify...
Craig Topper [Sun, 6 May 2012 19:46:21 +0000 (19:46 +0000)]
Use MVT instead of EVT as the argument to all the shuffle decode functions. Simplify some of the decode functions.

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

11 years agoAdd VPERMQ/VPERMPD to the list of target specific shuffles that can be looked through...
Craig Topper [Sun, 6 May 2012 18:54:26 +0000 (18:54 +0000)]
Add VPERMQ/VPERMPD to the list of target specific shuffles that can be looked through for DAG combine purposes.

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

11 years agoAdd shuffle decode support for VPERMQ/VPERMPD.
Craig Topper [Sun, 6 May 2012 18:44:02 +0000 (18:44 +0000)]
Add shuffle decode support for VPERMQ/VPERMPD.

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

11 years agoTableGen: AsmMatcher diagnostic when missing instruction mnemonic.
Jim Grosbach [Sun, 6 May 2012 17:33:14 +0000 (17:33 +0000)]
TableGen: AsmMatcher diagnostic when missing instruction mnemonic.

Previously, if an instruction definition was missing the mnemonic,
the next line would just assert(). Issue a real diagnostic instead.

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

11 years agomake SourceMgr tolerate empty SMLoc()'s better.
Chris Lattner [Sun, 6 May 2012 16:20:49 +0000 (16:20 +0000)]
make SourceMgr tolerate empty SMLoc()'s better.

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

11 years agoSwitch the select to branch transformation on by default.
Benjamin Kramer [Sun, 6 May 2012 14:25:16 +0000 (14:25 +0000)]
Switch the select to branch transformation on by default.

The primitive conservative heuristic seems to give a slight overall
improvement while not regressing stuff. Make it available to wider
testing. If you notice any speed regressions (or significant code
size regressions) let me know!

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

11 years agoRemove trailing spaces.
Jakub Staszak [Sun, 6 May 2012 13:52:31 +0000 (13:52 +0000)]
Remove trailing spaces.

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

11 years agoUnix/Process.inc: Give more useful random seed to srand. Workaround for PR12743.
NAKAMURA Takumi [Sun, 6 May 2012 08:24:24 +0000 (08:24 +0000)]
Unix/Process.inc: Give more useful random seed to srand. Workaround for PR12743.

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

11 years agoSupport/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix...
NAKAMURA Takumi [Sun, 6 May 2012 08:24:18 +0000 (08:24 +0000)]
Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix/Process.inc.

FIXME: GetRandomNumber() is not implemented in Win32.

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

11 years agoreapply my patch, with a fix for an off-by-one error. Turned out to be a lot
Chris Lattner [Sat, 5 May 2012 22:17:32 +0000 (22:17 +0000)]
reapply my patch, with a fix for an off-by-one error.  Turned out to be a lot
of work for a drive-by fix :)

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

11 years agorevert my patches, which are causing problems.
Chris Lattner [Sat, 5 May 2012 22:11:04 +0000 (22:11 +0000)]
revert my patches, which are causing problems.

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

11 years agoadd missing header <shame>
Chris Lattner [Sat, 5 May 2012 22:04:11 +0000 (22:04 +0000)]
add missing header <shame>

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

11 years agorefactor some code to expose column numbers more and make diagnostic printing slightl...
Chris Lattner [Sat, 5 May 2012 21:39:51 +0000 (21:39 +0000)]
refactor some code to expose column numbers more and make diagnostic printing slightly more efficient.

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

11 years agoNuke a few dead remnants of the CBE.
Jim Grosbach [Sat, 5 May 2012 17:45:12 +0000 (17:45 +0000)]
Nuke a few dead remnants of the CBE.

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

11 years ago[Support] Add missing include.
Daniel Dunbar [Sat, 5 May 2012 16:49:11 +0000 (16:49 +0000)]
[Support] Add missing include.

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

11 years ago[Support] Fix up comments.
Daniel Dunbar [Sat, 5 May 2012 16:39:22 +0000 (16:39 +0000)]
[Support] Fix up comments.

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

11 years ago[Support] Rewrite sys::fs::unique_file to not be stupid with /dev/urandom.
Daniel Dunbar [Sat, 5 May 2012 16:36:24 +0000 (16:36 +0000)]
[Support] Rewrite sys::fs::unique_file to not be stupid with /dev/urandom.
 - Just use sys::Process::GetRandomNumber instead of having two poor
   implementations.
 - This is ~70 times (!) faster on my OS X machine.

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

11 years ago[Support] Add sys::Process::GetRandomNumber().
Daniel Dunbar [Sat, 5 May 2012 16:36:20 +0000 (16:36 +0000)]
[Support] Add sys::Process::GetRandomNumber().
 - Primitive API, but we rarely have need for random numbers.

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

11 years ago[build] Add build check for ::arc4random().
Daniel Dunbar [Sat, 5 May 2012 16:36:16 +0000 (16:36 +0000)]
[build] Add build check for ::arc4random().

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

11 years agoUpdate all outdated autoconf files in the sample project.
Benjamin Kramer [Sat, 5 May 2012 15:02:39 +0000 (15:02 +0000)]
Update all outdated autoconf files in the sample project.

We might just use symlinks here, but I'm afraid of possible portability issues.

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

11 years agoCodeGenPrepare: Add a transform to turn selects into branches in some cases.
Benjamin Kramer [Sat, 5 May 2012 12:49:22 +0000 (12:49 +0000)]
CodeGenPrepare: Add a transform to turn selects into branches in some cases.

This came up when a change in block placement formed a cmov and slowed down a
hot loop by 50%:

ucomisd (%rdi), %xmm0
cmovbel %edx, %esi

cmov is a really bad choice in this context because it doesn't get branch
prediction. If we emit it as a branch, an out-of-order CPU can do a better job
(if the branch is predicted right) and avoid waiting for the slow load+compare
instruction to finish. Of course it won't help if the branch is unpredictable,
but those are really rare in practice.

This patch uses a dumb conservative heuristic, it turns all cmovs that have one
use and a direct memory operand into branches. cmovs usually save some code
size, so we disable the transform in -Os mode. In-Order architectures are
unlikely to benefit as well, those are included in the
"predictableSelectIsExpensive" flag.

It would be better to reuse branch probability info here, but BPI doesn't
support select instructions currently. It would make sense to use the same
heuristics as the if-converter pass, which does the opposite direction of this
transform.

Test suite shows a small improvement here and there on corei7-level machines,
but the actual results depend a lot on the used microarchitecture. The
transformation is currently disabled by default and available by passing the
-enable-cgp-select2branch flag to the code generator.

Thanks to Chandler for the initial test case to him and Evan Cheng for providing
me with comments and test-suite numbers that were more stable than mine :)

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

11 years agoAdd a new target hook "predictableSelectIsExpensive".
Benjamin Kramer [Sat, 5 May 2012 12:49:14 +0000 (12:49 +0000)]
Add a new target hook "predictableSelectIsExpensive".

This will be used to determine whether it's profitable to turn a select into a
branch when the branch is likely to be predicted.

Currently enabled for everything but Atom on X86 and Cortex-A9 devices on ARM.

I'm not entirely happy with the name of this flag, suggestions welcome ;)

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

11 years agoNVPTX: Initialize the UseF32FTZ flag.
Benjamin Kramer [Sat, 5 May 2012 11:22:02 +0000 (11:22 +0000)]
NVPTX: Initialize the UseF32FTZ flag.

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

11 years agoSmall fix in InstCombineCasts.cpp. Restored "alloca + bitcast" reducing for case...
Stepan Dyatkovskiy [Sat, 5 May 2012 07:09:40 +0000 (07:09 +0000)]
Small fix in InstCombineCasts.cpp. Restored "alloca + bitcast" reducing for case when alloca's size is calculated within the "add/sub/... nsw".
Also added fix to 2011-06-13-nsw-alloca.ll test.

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

11 years agoTypo.
Eric Christopher [Sat, 5 May 2012 01:16:06 +0000 (01:16 +0000)]
Typo.

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

11 years agoOrder register classes by spill size first, members last.
Jakob Stoklund Olesen [Fri, 4 May 2012 23:12:22 +0000 (23:12 +0000)]
Order register classes by spill size first, members last.

This is still a topological ordering such that every register class gets
a smaller enum value than its sub-classes.

Placing the smaller spill sizes first makes a difference for the
super-register class bit masks. When looking for a super-register class,
we usually want the smallest possible kind of super-register. That is
now available as the first bit set in the bit mask.

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

11 years agoMake sure findRepresentativeClass picks the widest super-register.
Jakob Stoklund Olesen [Fri, 4 May 2012 22:53:28 +0000 (22:53 +0000)]
Make sure findRepresentativeClass picks the widest super-register.

We want the representative register class to contain the largest
super-registers available. This makes the function less sensitive to the
register class numbering.

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