platform/upstream/llvm.git
11 years ago[ASan] try to fix Windows build
Alexey Samsonov [Mon, 1 Jul 2013 16:38:38 +0000 (16:38 +0000)]
[ASan] try to fix Windows build

llvm-svn: 185345

11 years ago[PowerPC] Add variants of "sync" instruction
Ulrich Weigand [Mon, 1 Jul 2013 16:37:52 +0000 (16:37 +0000)]
[PowerPC] Add variants of "sync" instruction

This adds support for the "sync $L" instruction with operand,
and provides aliases for "lwsync" and "ptesync".

llvm-svn: 185344

11 years agoImplement n3658 - Compile-time integer sequences
Marshall Clow [Mon, 1 Jul 2013 16:26:55 +0000 (16:26 +0000)]
Implement n3658 - Compile-time integer sequences

llvm-svn: 185343

11 years ago[ASan] Properly disable strict init-order checking when pthread_create is called
Alexey Samsonov [Mon, 1 Jul 2013 16:16:41 +0000 (16:16 +0000)]
[ASan] Properly disable strict init-order checking when pthread_create is called

llvm-svn: 185342

11 years ago[msan] Intercept stpcpy.
Evgeniy Stepanov [Mon, 1 Jul 2013 15:19:37 +0000 (15:19 +0000)]
[msan] Intercept stpcpy.

llvm-svn: 185340

11 years agoARM: relax the atomic release barrier to "dmb ishst"
Tim Northover [Mon, 1 Jul 2013 14:48:48 +0000 (14:48 +0000)]
ARM: relax the atomic release barrier to "dmb ishst"

I believe the full "dmb ish" barrier is not required to guarantee release
semantics for atomic operations. The weaker "dmb ishst" prevents previous
operations being reordered with a store executed afterwards, which is enough.

A key point to note (fortunately already correct) is that this barrier alone is
*insufficient* for sequential consistency, no matter how liberally placed.

llvm-svn: 185339

11 years ago[sanitizer] Intercept getnameinfo.
Evgeniy Stepanov [Mon, 1 Jul 2013 13:51:31 +0000 (13:51 +0000)]
[sanitizer] Intercept getnameinfo.

llvm-svn: 185338

11 years agoAvoid column limit violation in block comments in certain cases.
Alexander Kornienko [Mon, 1 Jul 2013 13:42:42 +0000 (13:42 +0000)]
Avoid column limit violation in block comments in certain cases.

Summary:
Add penalty when an excessively long line in a block comment can not be
broken on a leading whitespace. Lack of this addition can lead to severe column
width violations when they can be easily avoided.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1071

llvm-svn: 185337

11 years ago[NVPTX] Add support for module-scope inline asm
Justin Holewinski [Mon, 1 Jul 2013 13:00:14 +0000 (13:00 +0000)]
[NVPTX] Add support for module-scope inline asm

Since we were explicitly not calling AsmPrinter::doInitialization,
any module-scope inline asm was not being printed.

llvm-svn: 185336

11 years ago[NVPTX] We dont use NVBuiltin anymore
Justin Holewinski [Mon, 1 Jul 2013 12:59:08 +0000 (12:59 +0000)]
[NVPTX] We dont use NVBuiltin anymore

llvm-svn: 185335

11 years ago[NVPTX] Cut down on physical register defs
Justin Holewinski [Mon, 1 Jul 2013 12:59:06 +0000 (12:59 +0000)]
[NVPTX] Cut down on physical register defs

We are using virtual registers throughout now, but we still need
to keep a few physical registers per class around to keep the
infrastructure happy.

llvm-svn: 185334

11 years ago[NVPTX] 64-bit ADDC/ADDE are not legal
Justin Holewinski [Mon, 1 Jul 2013 12:59:04 +0000 (12:59 +0000)]
[NVPTX] 64-bit ADDC/ADDE are not legal

llvm-svn: 185333

11 years ago[NVPTX] Fix vector loads from parameters that span multiple loads, and fix some typos
Justin Holewinski [Mon, 1 Jul 2013 12:59:01 +0000 (12:59 +0000)]
[NVPTX] Fix vector loads from parameters that span multiple loads, and fix some typos

llvm-svn: 185332

11 years ago[NVPTX] Handle signext/zeroext attributes properly
Justin Holewinski [Mon, 1 Jul 2013 12:58:58 +0000 (12:58 +0000)]
[NVPTX] Handle signext/zeroext attributes properly

Fix a case where we were incorrectly sign-extending a value when we should have been zero-extending the value.

Also change some SIGN_EXTEND to ANY_EXTEND because we really dont care and may have more opportunity to fold subexpressions

llvm-svn: 185331

11 years ago[NVPTX] Add support for native SIGN_EXTEND_INREG where available
Justin Holewinski [Mon, 1 Jul 2013 12:58:56 +0000 (12:58 +0000)]
[NVPTX] Add support for native SIGN_EXTEND_INREG where available

llvm-svn: 185330

11 years ago[NVPTX] Add isel patterns for [reg+offset] form of ldg/ldu.
Justin Holewinski [Mon, 1 Jul 2013 12:58:52 +0000 (12:58 +0000)]
[NVPTX] Add isel patterns for [reg+offset] form of ldg/ldu.

llvm-svn: 185329

11 years ago[NVPTX] Make sure we zero out high-order 24 bits for 8-bit load into 32-bit value
Justin Holewinski [Mon, 1 Jul 2013 12:58:48 +0000 (12:58 +0000)]
[NVPTX] Make sure we zero out high-order 24 bits for 8-bit load into 32-bit value

llvm-svn: 185328

11 years agoDon't align "} // namespace" comments.
Daniel Jasper [Mon, 1 Jul 2013 11:22:57 +0000 (11:22 +0000)]
Don't align "} // namespace" comments.

This is not all bad, but people are often surprised by it.

Before:
namespace {
int SomeVariable = 0; // comment
}                     // namespace

After:
namespace {
int SomeVariable = 0; // comment
} // namespace

llvm-svn: 185327

11 years agoChange __sanitizer_symbolize_demangle hook return type to 'int'
Alexey Samsonov [Mon, 1 Jul 2013 11:20:56 +0000 (11:20 +0000)]
Change __sanitizer_symbolize_demangle hook return type to 'int'

llvm-svn: 185326

11 years ago[ASan] Cache atos processes to make Darwin symbolication faster.
Alexander Potapenko [Mon, 1 Jul 2013 10:51:31 +0000 (10:51 +0000)]
[ASan] Cache atos processes to make Darwin symbolication faster.

Patch by Jesse Ruderman<jruderman@gmail.com>

llvm-svn: 185325

11 years ago[sanitizer] Use the correct macro to check glibc version.
Sergey Matveev [Mon, 1 Jul 2013 10:15:29 +0000 (10:15 +0000)]
[sanitizer] Use the correct macro to check glibc version.

llvm-svn: 185324

11 years agoclang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on...
NAKAMURA Takumi [Mon, 1 Jul 2013 09:51:55 +0000 (09:51 +0000)]
clang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on cygwin.

Cygwin does not accept the form /CYGDRIVE/X/PATH/TO/FILE against /cygdrive/X/PATH/TO/FILE.
"cygdrive" must be lower-cased.

llvm-svn: 185323

11 years agollvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" can be...
NAKAMURA Takumi [Mon, 1 Jul 2013 09:51:42 +0000 (09:51 +0000)]
llvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" can be removed.

FIXME: Could we use llvm::sys::Path here?
llvm-svn: 185322

11 years agoDon't add an extra space before ellipsis after pointers.
Daniel Jasper [Mon, 1 Jul 2013 09:47:25 +0000 (09:47 +0000)]
Don't add an extra space before ellipsis after pointers.

Before (for styles where the pointer binds to the type):
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts* ... ts) {}
After:
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts*... ts) {}

llvm-svn: 185321

11 years agoKeep space between pointer and block comment.
Daniel Jasper [Mon, 1 Jul 2013 09:34:09 +0000 (09:34 +0000)]
Keep space between pointer and block comment.

Before: void f(int */* unused */) {}
After:  void f(int * /* unused */) {}

The previous version seems to be valid C++ code but confuses many syntax
highlighters.

llvm-svn: 185320

11 years agoFix braced-list detection in lieu of trailing comments.
Daniel Jasper [Mon, 1 Jul 2013 09:15:46 +0000 (09:15 +0000)]
Fix braced-list detection in lieu of trailing comments.

Before:
DoSomethingWithVector({
} /* No data */);
After:
DoSomethingWithVector({} /* No data */);

llvm-svn: 185319

11 years ago[ASan] Add sanity test for asan_symbolize.py script
Alexey Samsonov [Mon, 1 Jul 2013 09:15:19 +0000 (09:15 +0000)]
[ASan] Add sanity test for asan_symbolize.py script

llvm-svn: 185318

11 years ago[sanitizer] Fix build with older kernels.
Evgeniy Stepanov [Mon, 1 Jul 2013 09:10:34 +0000 (09:10 +0000)]
[sanitizer] Fix build with older kernels.

PTRACE_SETREGSET & PTRACE_GETREGSET may be missing from linux headers.

llvm-svn: 185317

11 years agoAdded the test missed from r185080.
Serge Pavlov [Mon, 1 Jul 2013 09:02:33 +0000 (09:02 +0000)]
Added the test missed from r185080.

llvm-svn: 185316

11 years ago[ASan] Remove leading underscores from function names in output tests
Alexey Samsonov [Mon, 1 Jul 2013 08:41:45 +0000 (08:41 +0000)]
[ASan] Remove leading underscores from function names in output tests

llvm-svn: 185315

11 years agoHide mlock/munlock info message under verbosity flag.
Alexey Samsonov [Mon, 1 Jul 2013 08:25:29 +0000 (08:25 +0000)]
Hide mlock/munlock info message under verbosity flag.

llvm-svn: 185314

11 years agoFollowing the modification introduced in llvm by commit 185311
Sylvestre Ledru [Mon, 1 Jul 2013 08:21:36 +0000 (08:21 +0000)]
Following the modification introduced in llvm by commit 185311

The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16446.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185313

11 years agoFollowing the modification introduced in llvm by commit 185311
Sylvestre Ledru [Mon, 1 Jul 2013 08:13:34 +0000 (08:13 +0000)]
Following the modification introduced in llvm by commit 185311

The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16445.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185312

11 years agoThe build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
Sylvestre Ledru [Mon, 1 Jul 2013 08:07:52 +0000 (08:07 +0000)]
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16444.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185311

11 years ago[PECOFF][Writer] Set SizeOfInitializedData file header.
Rui Ueyama [Mon, 1 Jul 2013 08:06:48 +0000 (08:06 +0000)]
[PECOFF][Writer] Set SizeOfInitializedData file header.

llvm-svn: 185310

11 years ago[PECOFF][Writer] Add setter methods that sets the import address table location to...
Rui Ueyama [Mon, 1 Jul 2013 07:59:17 +0000 (07:59 +0000)]
[PECOFF][Writer] Add setter methods that sets the import address table location to file header.

llvm-svn: 185309

11 years ago[PECOFF][Writer] Do not emit the empty section as Windows loader rejects such executable.
Rui Ueyama [Mon, 1 Jul 2013 07:32:12 +0000 (07:32 +0000)]
[PECOFF][Writer] Do not emit the empty section as Windows loader rejects such executable.

llvm-svn: 185308

11 years ago[PECOFF][Writer] Amend the comment about DLL linking.
Rui Ueyama [Mon, 1 Jul 2013 07:25:30 +0000 (07:25 +0000)]
[PECOFF][Writer] Amend the comment about DLL linking.

llvm-svn: 185307

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:34:58 +0000 (06:34 +0000)]
Put helper class in anonymous namespace.

llvm-svn: 185306

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:29:40 +0000 (06:29 +0000)]
Put helper class in anonymous namespace.

llvm-svn: 185305

11 years agoPR16502: Fix a dumb bug where we might look past the last initializer in an
Richard Smith [Mon, 1 Jul 2013 06:08:20 +0000 (06:08 +0000)]
PR16502: Fix a dumb bug where we might look past the last initializer in an
InitListExpr.

llvm-svn: 185304

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:21:54 +0000 (04:21 +0000)]
Put helper classes in an anonymous namespace.

llvm-svn: 185303

11 years agoUse LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.
Craig Topper [Mon, 1 Jul 2013 04:07:34 +0000 (04:07 +0000)]
Use LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.

llvm-svn: 185302

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:03:19 +0000 (04:03 +0000)]
Put helper classes in an anonymous namespace.

llvm-svn: 185301

11 years agoUse static for helper functions instead of an anonymous namespace per coding standards.
Craig Topper [Mon, 1 Jul 2013 03:38:29 +0000 (03:38 +0000)]
Use static for helper functions instead of an anonymous namespace per coding standards.

llvm-svn: 185300

11 years agoLoopVectorize: Math functions only read rounding mode
Arnold Schwaighofer [Mon, 1 Jul 2013 00:54:44 +0000 (00:54 +0000)]
LoopVectorize: Math functions only read rounding mode

Math functions are mark as readonly because they read the floating point
rounding mode. Because we don't vectorize loops that would contain function
calls that set the rounding mode it is safe to ignore this memory read.

llvm-svn: 185299

11 years agoIn istream::ignore, check the delimeter as an int_type, not as a char_type, so as...
Howard Hinnant [Mon, 1 Jul 2013 00:37:50 +0000 (00:37 +0000)]
In istream::ignore, check the delimeter as an int_type, not as a char_type, so as to correctly handle EOF.  This fixes llvm.org/bugs/show_bug.cgi?id=16427

llvm-svn: 185298

11 years agoThe bind and function functor constructors and assignment operators were overly gener...
Howard Hinnant [Mon, 1 Jul 2013 00:01:51 +0000 (00:01 +0000)]
The bind and function functor constructors and assignment operators were overly general and getting confused with the copy constructor and copy assignment operators.  Constrained them.  This fixes llvm.org/bugs/show_bug.cgi?id=16385

llvm-svn: 185297

11 years agoMake string pointer const.
Craig Topper [Sun, 30 Jun 2013 22:44:02 +0000 (22:44 +0000)]
Make string pointer const.

llvm-svn: 185296

11 years agoPut helper classes into anonymous namespace.
Craig Topper [Sun, 30 Jun 2013 22:29:28 +0000 (22:29 +0000)]
Put helper classes into anonymous namespace.

llvm-svn: 185295

11 years agoR600: Fix an unitialized variable in R600InstrInfo.cpp
Vincent Lejeune [Sun, 30 Jun 2013 21:44:06 +0000 (21:44 +0000)]
R600: Fix an unitialized variable in R600InstrInfo.cpp

llvm-svn: 185294

11 years agoDocumentation cleanup for TypeOrdering.h.
James Dennett [Sun, 30 Jun 2013 21:23:07 +0000 (21:23 +0000)]
Documentation cleanup for TypeOrdering.h.

llvm-svn: 185293

11 years agoX86: POP*rmm: move address operand to (ins) from (outs).
Ahmed Bougacha [Sun, 30 Jun 2013 20:44:50 +0000 (20:44 +0000)]
X86: POP*rmm: move address operand to (ins) from (outs).

llvm-svn: 185292

11 years agoRestore r184205 and associated commits (after commit of r185290)
Stephen Lin [Sun, 30 Jun 2013 20:40:16 +0000 (20:40 +0000)]
Restore r184205 and associated commits (after commit of r185290)

This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.

llvm-svn: 185291

11 years agoDeadArgumentElimination: keep return value on functions that have a live argument...
Stephen Lin [Sun, 30 Jun 2013 20:26:21 +0000 (20:26 +0000)]
DeadArgumentElimination: keep return value on functions that have a live argument with the 'returned' attribute (rather than generate invalid IR); however, if both can be eliminated, both will be

llvm-svn: 185290

11 years agoFix bind by making _is_valid_bind_return more robust. It should return false instead...
Howard Hinnant [Sun, 30 Jun 2013 19:48:15 +0000 (19:48 +0000)]
Fix bind by making _is_valid_bind_return more robust.  It should return false instead of give a compile time error, always.  The problem was down in ____mu_return, the version that handles nested bind objects.  This fixes llvm.org/bugs/show_bug.cgi?id=16343

llvm-svn: 185289

11 years agoDocumentation cleanup: Mostly formatting \brief documentation, also fix a
James Dennett [Sun, 30 Jun 2013 19:39:15 +0000 (19:39 +0000)]
Documentation cleanup: Mostly formatting \brief documentation, also fix a
typo or two.

llvm-svn: 185288

11 years agoAlways set -m32/-m64 flags for targeting i386/x86_64 respectively. Apparently, there...
Alexey Samsonov [Sun, 30 Jun 2013 16:21:32 +0000 (16:21 +0000)]
Always set -m32/-m64 flags for targeting i386/x86_64 respectively. Apparently, there are platforms where the clang defaults are different from gcc

llvm-svn: 185287

11 years agoDefine the path to llvm-symbolizer tool in a common config to reduce copy-paste
Alexey Samsonov [Sun, 30 Jun 2013 14:47:38 +0000 (14:47 +0000)]
Define the path to llvm-symbolizer tool in a common config to reduce copy-paste

llvm-svn: 185286

11 years ago[PECOFF][Writer] Fix buildbot failure on x86_64-win7.
Rui Ueyama [Sun, 30 Jun 2013 14:14:44 +0000 (14:14 +0000)]
[PECOFF][Writer] Fix buildbot failure on x86_64-win7.

llvm-svn: 185285

11 years agoConstantFold: Check that truncating the other side is safe under a sext when trying...
Benjamin Kramer [Sun, 30 Jun 2013 13:47:43 +0000 (13:47 +0000)]
ConstantFold: Check that truncating the other side is safe under a sext when trying to remove a sext from a compare.

Fixes PR16462.

llvm-svn: 185284

11 years ago[PECOFF][Reader] Create a jump table for functions exported by DLL.
Rui Ueyama [Sun, 30 Jun 2013 13:33:36 +0000 (13:33 +0000)]
[PECOFF][Reader] Create a jump table for functions exported by DLL.

llvm-svn: 185283

11 years agoTeach -Wunsequenced that the side-effects of a function evaluation are sequenced
Richard Smith [Sun, 30 Jun 2013 10:40:20 +0000 (10:40 +0000)]
Teach -Wunsequenced that the side-effects of a function evaluation are sequenced
before the value computation of the result. In C, this is implied by there being
a sequence point after their evaluation, and in C++, it's implied by the
side-effects being sequenced before the expressions and statements in the
function body.

llvm-svn: 185282

11 years agoReinstate r185229, reverted in r185256, with a tweak: further ignore the
Richard Smith [Sun, 30 Jun 2013 09:48:50 +0000 (09:48 +0000)]
Reinstate r185229, reverted in r185256, with a tweak: further ignore the
standard's rule that an extern "C" declaration conflicts with any entity in the
global scope with the same name. Now we only care if the global scope entity is
a variable declaration (and so might have the same mangled name as the extern
"C" declaration). This has been reported as a standard defect.

Original commit message:

PR7927, PR16247: Reimplement handling of matching extern "C" declarations
across scopes.

When we declare an extern "C" name that is not a redeclaration of an entity in
the same scope, check whether it redeclares some extern "C" entity from another
scope, and if not, check whether it conflicts with a (non-extern-"C") entity in
the translation unit.

When we declare a name in the translation unit that is not a redeclaration,
check whether it conflicts with any extern "C" entities (possibly from other
scopes).

llvm-svn: 185281

11 years agoLex: Cleanup whitespace in PragmaRegionHandler
David Majnemer [Sun, 30 Jun 2013 08:18:16 +0000 (08:18 +0000)]
Lex: Cleanup whitespace in PragmaRegionHandler

llvm-svn: 185280

11 years agoBug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr call
James Dennett [Sun, 30 Jun 2013 03:13:35 +0000 (03:13 +0000)]
Bug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr call
WalkUpFromLambdaExpr, so that the Visit* functions are called
on that AST node.

llvm-svn: 185277

11 years agoAdd enumerators to TestVisitor::Language to allow visitor tests to
James Dennett [Sun, 30 Jun 2013 03:05:49 +0000 (03:05 +0000)]
Add enumerators to TestVisitor::Language to allow visitor tests to
explicitly specify use of C++98 or C++11. Lang_CXX is preserved as
an alias for Lang_CXX98.

This does not add Lang_CXX1Y or Lang_C11, on the assumption that it's
better to add them if/when they are needed.

(This is a prerequisite for a test in a later patch for RecursiveASTVisitor.)

Reviewed by Richard Smith.

llvm-svn: 185276

11 years agoMatthew Dempsky: POSIX defines that the _POSIX_C_SOURCE macros are to be set by user
Howard Hinnant [Sun, 30 Jun 2013 00:14:43 +0000 (00:14 +0000)]
Matthew Dempsky: POSIX defines that the _POSIX_C_SOURCE macros are to be set by user
code to specify what version of POSIX the system should provide.  If
you want to check what version of POSIX is actually available, you're
supposed to test _POSIX_VERSION.

However, since sysconf() has been in POSIX since 1995, it's probably
safe to assume it's available on any system with a C++11 compiler,
especially if _SC_NPROCESSORS_ONLN is defined too.  So no point in a
complicated preprocessor rule if just we unconditionally include
<unistd.h> (on non-Windows systems).

Also, I've added a #warning for to help porters detect when a suitable
implementation isn't detected at compile-time.

Howard:  Matthew, can you patch CREDITS.TXT?  Thanks.
llvm-svn: 185275

11 years agoMatthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed 'len...
Howard Hinnant [Sat, 29 Jun 2013 23:53:20 +0000 (23:53 +0000)]
Matthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed 'len strlen(msg)', so we can use memcpy() instead of strcpy().

llvm-svn: 185274

11 years agoPrevent '\b' from backing up into invalid memory. Fixes http://llvm.org/bugs/show_bu...
Howard Hinnant [Sat, 29 Jun 2013 23:45:43 +0000 (23:45 +0000)]
Prevent '\b' from backing up into invalid memory.  Fixes llvm.org/bugs/show_bug.cgi?id=16240.  Sorry, I can not think of a good test case for this one, except by running valgrind as reported in the bug.

llvm-svn: 185273

11 years agoValueTracking: Teach isKnownToBeAPowerOfTwo about (ADD X, (XOR X, Y)) where X is...
David Majnemer [Sat, 29 Jun 2013 23:44:53 +0000 (23:44 +0000)]
ValueTracking: Teach isKnownToBeAPowerOfTwo about (ADD X, (XOR X, Y)) where X is a power of two

This allows us to simplify urem instructions involving the add+xor to
turn into simpler math.

llvm-svn: 185272

11 years agoNVPTX: Fold otherwise unused variable into assert.
Benjamin Kramer [Sat, 29 Jun 2013 22:51:12 +0000 (22:51 +0000)]
NVPTX: Fold otherwise unused variable into assert.

Avoids unused variable warnings in release builds.

llvm-svn: 185271

11 years agoInstCombine: Also turn selects fed by an and into arithmetic when the types don't...
Benjamin Kramer [Sat, 29 Jun 2013 21:17:04 +0000 (21:17 +0000)]
InstCombine: Also turn selects fed by an and into arithmetic when the types don't match.

Inserting a zext or trunc is sufficient. This pattern is somewhat common in
LLVM's pointer mangling code.

llvm-svn: 185270

11 years agoR600: Unbreak GCC build.
Benjamin Kramer [Sat, 29 Jun 2013 20:04:19 +0000 (20:04 +0000)]
R600: Unbreak GCC build.

operator++ on an enum is not legal. clang happens to accept it anyways, I think
that's a known bug.

llvm-svn: 185269

11 years agoR600: Support schedule and packetization of trans-only inst
Vincent Lejeune [Sat, 29 Jun 2013 19:32:43 +0000 (19:32 +0000)]
R600: Support schedule and packetization of trans-only inst

llvm-svn: 185268

11 years agoR600: Bank Swizzle now display SCL equivalent
Vincent Lejeune [Sat, 29 Jun 2013 19:32:29 +0000 (19:32 +0000)]
R600: Bank Swizzle now display SCL equivalent

llvm-svn: 185267

11 years agomisched: Compress pairs returned by getUnderlyingObjectsForInstr.
Benjamin Kramer [Sat, 29 Jun 2013 18:41:17 +0000 (18:41 +0000)]
misched: Compress pairs returned by getUnderlyingObjectsForInstr.

llvm-svn: 185266

11 years agoAdd operators to make launch a bitmask type. Searched all of the standard, and libc...
Howard Hinnant [Sat, 29 Jun 2013 18:38:17 +0000 (18:38 +0000)]
Add operators to make launch a bitmask type.  Searched all of the standard, and libc++ to see if this error occurred elsewhere and didn't see any other place.  This fixes llvm.org/bugs/show_bug.cgi?id=16207

llvm-svn: 185265

11 years agoCompress pairs. No functionality change.
Benjamin Kramer [Sat, 29 Jun 2013 17:52:13 +0000 (17:52 +0000)]
Compress pairs. No functionality change.

llvm-svn: 185264

11 years agoLoopVectorizer: Pack MemAccessInfo pairs.
Benjamin Kramer [Sat, 29 Jun 2013 17:52:08 +0000 (17:52 +0000)]
LoopVectorizer: Pack MemAccessInfo pairs.

llvm-svn: 185263

11 years agoMove helper classes into anonymous namespaces.
Benjamin Kramer [Sat, 29 Jun 2013 17:02:06 +0000 (17:02 +0000)]
Move helper classes into anonymous namespaces.

llvm-svn: 185262

11 years agoDriver: Push triple objects around instead of going to std::string all the time.
Benjamin Kramer [Sat, 29 Jun 2013 16:37:14 +0000 (16:37 +0000)]
Driver: Push triple objects around instead of going to std::string all the time.

No functionality change.

llvm-svn: 185261

11 years agoBlockGenerator: Simplify the old value searching code.
Hongbin Zheng [Sat, 29 Jun 2013 13:22:15 +0000 (13:22 +0000)]
BlockGenerator: Simplify the old value searching code.

Orignally, we first test if a ValueMap contains a Value, and than use the
index operator to get the corresponding new value. This requires the ValueMap
to lookup the key (i.e. the old value) twice.

Now, we directly use the "lookup" function provided by DenseMap to implement
the same functionality.

llvm-svn: 185260

11 years agoInstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison
David Majnemer [Sat, 29 Jun 2013 10:28:04 +0000 (10:28 +0000)]
InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison

Changing the sign when comparing the base pointer would introduce all
sorts of unexpected things like:
  %gep.i = getelementptr inbounds [1 x i8]* %a, i32 0, i32 0
  %gep2.i = getelementptr inbounds [1 x i8]* %b, i32 0, i32 0
  %cmp.i = icmp ult i8* %gep.i, %gep2.i
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = icmp ne i1 %cmp.i, %cmp.i1
  ret i1 %cmp

into:
  %cmp.i = icmp slt [1 x i8]* %a, %b
  %cmp.i1 = icmp ult [1 x i8]* %a, %b
  %cmp = xor i1 %cmp.i, %cmp.i1
  ret i1 %cmp

By preserving the original sign, we now get:
  ret i1 false

This fixes PR16483.

llvm-svn: 185259

11 years agoInstCombine: Small whitespace cleanup in FoldGEPICmp
David Majnemer [Sat, 29 Jun 2013 09:45:35 +0000 (09:45 +0000)]
InstCombine: Small whitespace cleanup in FoldGEPICmp

llvm-svn: 185258

11 years agoInstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms
David Majnemer [Sat, 29 Jun 2013 08:40:07 +0000 (08:40 +0000)]
InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms

Real world code sometimes has the denominator of a 'udiv' be a
'select'.  LLVM can handle such cases but only when the 'select'
operands are symmetric in structure (both select operands are a constant
power of two or a left shift, etc.).  This falls apart if we are dealt a
'udiv' where the code is not symetric or if the select operands lead us
to more select instructions.

Instead, we should treat the LHS and each select operand as a distinct
divide operation and try to optimize them independently.  If we can
to simplify each operation, then we can replace the 'udiv' with, say, a
'lshr' that has a new select with a bunch of new operands for the
select.

llvm-svn: 185257

11 years agoRevert r185229 as it breaks compilation of <windows.h>
Timur Iskhodzhanov [Sat, 29 Jun 2013 08:38:42 +0000 (08:38 +0000)]
Revert r185229 as it breaks compilation of <windows.h>

llvm-svn: 185256

11 years agoAdd the git attributes file.
Hongbin Zheng [Sat, 29 Jun 2013 07:21:57 +0000 (07:21 +0000)]
Add the git attributes file.

The attribute in the file allows git to perform End-of-Line
normalization (CRLF to LF).

llvm-svn: 185255

11 years agoTempScop: (Partial) Implement the printDetail function.
Hongbin Zheng [Sat, 29 Jun 2013 07:00:14 +0000 (07:00 +0000)]
TempScop: (Partial) Implement the printDetail function.

llvm-svn: 185254

11 years agoRefactor memory access getting code in ScopStmt.
Hongbin Zheng [Sat, 29 Jun 2013 06:31:39 +0000 (06:31 +0000)]
Refactor memory access getting code in ScopStmt.

1. Do not allow creating new memory access record in the InstructionToAccess map
   on the fly in function getAccessFor.
2. Do not allow user to modify the memory accesses returned by getAccessFor
   during the code generation process.

llvm-svn: 185253

11 years agoMinor change: No need to specify the namespace of raw_ostream.
Hongbin Zheng [Sat, 29 Jun 2013 06:30:55 +0000 (06:30 +0000)]
Minor change: No need to specify the namespace of raw_ostream.

llvm-svn: 185252

11 years agoWe preserve the CFG and some of the analysis passes.
Nadav Rotem [Sat, 29 Jun 2013 05:38:15 +0000 (05:38 +0000)]
We preserve the CFG and some of the analysis passes.

llvm-svn: 185251

11 years agoUpdate docs.
Nadav Rotem [Sat, 29 Jun 2013 05:37:19 +0000 (05:37 +0000)]
Update docs.

llvm-svn: 185250

11 years agoDebug Info: clean up usage of Verify.
Manman Ren [Sat, 29 Jun 2013 05:01:19 +0000 (05:01 +0000)]
Debug Info: clean up usage of Verify.

No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

llvm-svn: 185249

11 years agoMove a function into assert() so that GCC won't complain that the
Rui Ueyama [Sat, 29 Jun 2013 04:28:51 +0000 (04:28 +0000)]
Move a function into assert() so that GCC won't complain that the
function is not used in release build.

llvm-svn: 185248

11 years agoRemove extra ';'
Rui Ueyama [Sat, 29 Jun 2013 04:28:44 +0000 (04:28 +0000)]
Remove extra ';'

llvm-svn: 185247

11 years agoMore useful printout of arguments after the recent changes to support LLDB_TEST_ARGUMENTS
Enrico Granata [Sat, 29 Jun 2013 01:53:55 +0000 (01:53 +0000)]
More useful printout of arguments after the recent changes to support LLDB_TEST_ARGUMENTS

llvm-svn: 185246

11 years agoFixed SBProcess::RemoteLaunch() to use the platform executable path. Patch from Sebas...
Greg Clayton [Sat, 29 Jun 2013 00:10:32 +0000 (00:10 +0000)]
Fixed SBProcess::RemoteLaunch() to use the platform executable path. Patch from Sebastien Metrot.

llvm-svn: 185245

11 years ago[test] Add test case for rdar://14183893.
Argyrios Kyrtzidis [Fri, 28 Jun 2013 23:47:22 +0000 (23:47 +0000)]
[test] Add test case for rdar://14183893.

llvm-svn: 185244

11 years agoChange assert(0 && "text") to llvm_unreachable(0 && "text")
Richard Trieu [Fri, 28 Jun 2013 23:46:19 +0000 (23:46 +0000)]
Change assert(0 && "text") to llvm_unreachable(0 && "text")

llvm-svn: 185243