platform/upstream/llvm.git
11 years agoTeach x86 fast-isel to use AVX opcodes for vector stores when AVX is enabled.
Craig Topper [Wed, 17 Jul 2013 06:58:23 +0000 (06:58 +0000)]
Teach x86 fast-isel to use AVX opcodes for vector stores when AVX is enabled.

llvm-svn: 186496

11 years agotsan: fix unitialized read warning under newer gcc (it does not have visibility into...
Dmitry Vyukov [Wed, 17 Jul 2013 06:56:47 +0000 (06:56 +0000)]
tsan: fix unitialized read warning under newer gcc (it does not have visibility into asm)

llvm-svn: 186495

11 years agoLLVMSymbolize.cpp: Fix build. Triple::ArchType is not a namespace.
NAKAMURA Takumi [Wed, 17 Jul 2013 06:53:51 +0000 (06:53 +0000)]
LLVMSymbolize.cpp: Fix build. Triple::ArchType is not a namespace.

llvm-svn: 186494

11 years agollvm-symbolizer: be more careful with colons in file names
Alexey Samsonov [Wed, 17 Jul 2013 06:45:36 +0000 (06:45 +0000)]
llvm-symbolizer: be more careful with colons in file names

llvm-svn: 186493

11 years agoclang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.
NAKAMURA Takumi [Wed, 17 Jul 2013 06:39:40 +0000 (06:39 +0000)]
clang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.

llvm-svn: 186492

11 years agoMake x86 fast-isel correctly choose between aligned and unaligned operations for...
Craig Topper [Wed, 17 Jul 2013 05:57:45 +0000 (05:57 +0000)]
Make x86 fast-isel correctly choose between aligned and unaligned operations for vector stores. Fixes PR16640.

llvm-svn: 186491

11 years agoPropagate alignment for _Complex
JF Bastien [Wed, 17 Jul 2013 05:57:42 +0000 (05:57 +0000)]
Propagate alignment for _Complex

_Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex.

Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part).

llvm-svn: 186490

11 years agoFix ARMFastISel::ARMEmitIntExt shift emission
JF Bastien [Wed, 17 Jul 2013 05:46:46 +0000 (05:46 +0000)]
Fix ARMFastISel::ARMEmitIntExt shift emission

My patch 'r183551 - ARM FastISel integer sext/zext improvements' was incorrect when emitting ARM register-immediate ASR, LSL, LSR instructions: they are pseudo-instructions in ARMInstrInfo.td and I should have used MOVsi instead.

This is not an issue when code is generated through a .s file, but is an issue when generated straight to a .o (-filetype=obj).

llvm-svn: 186489

11 years agoPPC: Add CTR-register clobber to builtin setjmp
Hal Finkel [Wed, 17 Jul 2013 05:35:44 +0000 (05:35 +0000)]
PPC: Add CTR-register clobber to builtin setjmp

Because the builtin longjmp implementation uses a CTR-based indirect jump, when
the control flow arrives at the builtin setjmp call, the CTR register has
necessarily been clobbered. Correspondingly, this adds CTR to the list of
implicit definitions of the builtin setjmp pseudo instruction.

We don't need to add CTR to the implicit definitions of builtin longjmp
because, even though it does clobber the CTR register, the control flow cannot
return to inside the loop unless there is also a builtin setjmp call.

llvm-svn: 186488

11 years agoUse the simpler is_directory.
Rafael Espindola [Wed, 17 Jul 2013 04:23:07 +0000 (04:23 +0000)]
Use the simpler is_directory.

llvm-svn: 186487

11 years agoAdd simpler version of is_directory. It will be used in clang.
Rafael Espindola [Wed, 17 Jul 2013 04:20:49 +0000 (04:20 +0000)]
Add simpler version of is_directory. It will be used in clang.

llvm-svn: 186486

11 years agoMark a method 'const' and another 'static'.
Craig Topper [Wed, 17 Jul 2013 03:54:53 +0000 (03:54 +0000)]
Mark a method 'const' and another 'static'.

llvm-svn: 186485

11 years agoMake a few more static string pointers constant.
Craig Topper [Wed, 17 Jul 2013 03:43:10 +0000 (03:43 +0000)]
Make a few more static string pointers constant.

llvm-svn: 186484

11 years agoDon't fallback to copy + delete in rename.
Rafael Espindola [Wed, 17 Jul 2013 03:33:41 +0000 (03:33 +0000)]
Don't fallback to copy + delete in rename.

Rename's documentation says "Files are renamed as if by POSIX rename()". and it
is used for atomically updating output files from a temporary. Having rename
fallback to a non atomic copy has the potential to hide bugs, like using
a temporary file in /tmp instead of a unique name next to the final destination.

llvm-svn: 186483

11 years agoMake constant string pointer into an array to remove a pointer lookup for every access.
Craig Topper [Wed, 17 Jul 2013 03:11:32 +0000 (03:11 +0000)]
Make constant string pointer into an array to remove a pointer lookup for every access.

llvm-svn: 186482

11 years agoraw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, llvm::outs() would...
NAKAMURA Takumi [Wed, 17 Jul 2013 02:21:10 +0000 (02:21 +0000)]
raw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, llvm::outs() would be set to O_TEXT by default.

llvm/test/Object/check_binary_output.ll is expected to pass on win32.

llvm-svn: 186480

11 years agoSLPVectorizer: Accelerate the isConsecutive check by replacing the subtraction of...
Nadav Rotem [Wed, 17 Jul 2013 00:48:31 +0000 (00:48 +0000)]
SLPVectorizer: Accelerate the isConsecutive check by replacing the subtraction of the two values with a simple SCEV expression that adds the offset to one of the pointers that we compare.

llvm-svn: 186479

11 years agoPPC: Implement base pointer and stack realignment
Hal Finkel [Wed, 17 Jul 2013 00:45:52 +0000 (00:45 +0000)]
PPC: Implement base pointer and stack realignment

This builds on some frame-lowering code that has existed since 2005 (r24224)
but was disabled in 2008 (r48188) because it needed base pointer support to
function correctly. This implementation follows the strategy suggested by Dale
Johannesen in r48188 where the following comment was added:

  This does not currently work, because the delta between old and new stack
  pointers is added to offsets that reference incoming parameters after the
  prolog is generated, and the code that does that doesn't handle a variable
  delta.  You don't want to do that anyway; a better approach is to reserve
  another register that retains to the incoming stack pointer, and reference
  parameters relative to that.

And now we do exactly that. If we don't need a frame pointer, then we use r31
as a base pointer. If we do need a frame pointer, then we use r30 as a base
pointer. The base pointer retains the value of the stack pointer before it was
decremented in the prologue. We then use the base pointer to resolve all
negative frame indicies. The basic scheme follows that for base pointers in the
X86 backend.

We use a base pointer when we need to dynamically realign the incoming stack
pointer. This currently applies only to static objects (dynamic allocas with
large alignments, and base-pointer support in SjLj lowering will come in future
commits).

llvm-svn: 186478

11 years agollvm/test/CodeGen/X86/vec_setcc.ll: Add explicit -mtriple=x86_64-unknown-unknown...
NAKAMURA Takumi [Wed, 17 Jul 2013 00:42:37 +0000 (00:42 +0000)]
llvm/test/CodeGen/X86/vec_setcc.ll: Add explicit -mtriple=x86_64-unknown-unknown to satisfy win32-targeted configuration.

llvm-svn: 186477

11 years agoMove string pointer from being a static class member to just a static global in the...
Craig Topper [Wed, 17 Jul 2013 00:31:35 +0000 (00:31 +0000)]
Move string pointer from being a static class member to just a static global in the one file its needed in.

llvm-svn: 186476

11 years agosimple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathT...
Michael Sartain [Wed, 17 Jul 2013 00:26:30 +0000 (00:26 +0000)]
simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment

Differential Revision: http://llvm-reviews.chandlerc.com/D1159

llvm-svn: 186475

11 years agoMore code conformance.
Fariborz Jahanian [Wed, 17 Jul 2013 00:05:08 +0000 (00:05 +0000)]
More code conformance.

llvm-svn: 186474

11 years agoObjectiveC migrator: When adding conforming protocol,
Fariborz Jahanian [Wed, 17 Jul 2013 00:02:22 +0000 (00:02 +0000)]
ObjectiveC migrator: When adding conforming protocol,
only add outer-most conforming protocols as adding
others are redundant.

llvm-svn: 186473

11 years agoAdd pointer format test for Windows.
Howard Hinnant [Tue, 16 Jul 2013 23:50:06 +0000 (23:50 +0000)]
Add pointer format test for Windows.

llvm-svn: 186472

11 years agoAvoid breaking non-trailing block comments.
Alexander Kornienko [Tue, 16 Jul 2013 23:47:22 +0000 (23:47 +0000)]
Avoid breaking non-trailing block comments.

Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);

Formatting before the patch:
void ffffffffffff(int aaaaaa /* test
                              */);

Formatting after the patch:
void
ffffffffffff(int aaaaaa /* test */);

llvm-svn: 186471

11 years agoAdd getModuleFlag(StringRef Key) to query a module flag given Key.
Manman Ren [Tue, 16 Jul 2013 23:21:16 +0000 (23:21 +0000)]
Add getModuleFlag(StringRef Key) to query a module flag given Key.

No functionality change.

llvm-svn: 186470

11 years agollvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized message...
NAKAMURA Takumi [Tue, 16 Jul 2013 23:17:22 +0000 (23:17 +0000)]
llvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized message catalogue.

For example, 'No such file or directory' cannot be seen on Japanese version of msvcrt.

llvm-svn: 186469

11 years agollvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. Investigating.
NAKAMURA Takumi [Tue, 16 Jul 2013 23:16:57 +0000 (23:16 +0000)]
llvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. Investigating.

llvm-svn: 186468

11 years agoFollow coding convention in argument decl.
Fariborz Jahanian [Tue, 16 Jul 2013 23:01:33 +0000 (23:01 +0000)]
Follow coding convention in argument decl.

llvm-svn: 186467

11 years agoflip the scev minus direction to simplify the code.
Nadav Rotem [Tue, 16 Jul 2013 22:57:06 +0000 (22:57 +0000)]
flip the scev minus direction to simplify the code.

llvm-svn: 186466

11 years agoSLPVectorizer: Improve the compile time of isConsecutive by adding a simple constant...
Nadav Rotem [Tue, 16 Jul 2013 22:51:07 +0000 (22:51 +0000)]
SLPVectorizer: Improve the compile time of isConsecutive by adding a simple constant-gep check before using SCEV.
This check does not always work because not all of the GEPs use a constant offset, but it happens often enough to reduce the number of times we use SCEV.

llvm-svn: 186465

11 years agoMake Expr::isConstantInitializer match IRGen.
Eli Friedman [Tue, 16 Jul 2013 22:40:53 +0000 (22:40 +0000)]
Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++.  This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

llvm-svn: 186464

11 years agoGive compiler-rt a chance to compile with mingw-w64.
Anton Korobeynikov [Tue, 16 Jul 2013 22:37:55 +0000 (22:37 +0000)]
Give compiler-rt a chance to compile with mingw-w64.
Patch by C. Bergström!

llvm-svn: 186463

11 years ago[arcmt] Remove some dead code.
Argyrios Kyrtzidis [Tue, 16 Jul 2013 22:24:06 +0000 (22:24 +0000)]
[arcmt] Remove some dead code.

Patch by Rafael Espíndola.

llvm-svn: 186462

11 years agoRelated to r181161 - Indirect branches may not be the last branch in a basic
Lang Hames [Tue, 16 Jul 2013 22:01:40 +0000 (22:01 +0000)]
Related to r181161 - Indirect branches may not be the last branch in a basic
block. Blocks that have an indirect branch terminator, even if it's not the
last terminator, should still be treated as unanalyzable.

<rdar://problem/14437274>

Reducing a useful regression test case is proving difficult - I hope to have
one soon.

llvm-svn: 186461

11 years agoObjectiveC migrator. If a class implements a protocol's
Fariborz Jahanian [Tue, 16 Jul 2013 21:59:42 +0000 (21:59 +0000)]
ObjectiveC migrator. If a class implements a protocol's
properties, then class conforms to that protocol.

llvm-svn: 186460

11 years agoARM: Add support for the Thumb2 PLI alternate literal form.
Tilmann Scheller [Tue, 16 Jul 2013 21:52:34 +0000 (21:52 +0000)]
ARM: Add support for the Thumb2 PLI alternate literal form.

This adds an instruction alias to make the assembler recognize the alternate literal form: pli [PC, #+/-<imm>]

See A8.8.129 in the ARM ARM (DDI 0406C.b).

Fixes <rdar://problem/14403733>.

llvm-svn: 186459

11 years agoFix Rendezvous breakpoint to only be set once, resolve addr in BreakpointLocationList...
Michael Sartain [Tue, 16 Jul 2013 21:22:53 +0000 (21:22 +0000)]
Fix Rendezvous breakpoint to only be set once, resolve addr in BreakpointLocationList::FindByAddress

Differential Revision: http://llvm-reviews.chandlerc.com/D1145

llvm-svn: 186458

11 years agoFix typeos.
Jason Molenda [Tue, 16 Jul 2013 21:11:29 +0000 (21:11 +0000)]
Fix typeos.

llvm-svn: 186457

11 years agoDon't break line comments with escaped newlines.
Alexander Kornienko [Tue, 16 Jul 2013 21:06:13 +0000 (21:06 +0000)]
Don't break line comments with escaped newlines.

Summary:
These can appear when comments contain command lines with quoted line
breaks. As the text (including escaped newlines and '//' from consecutive lines)
is a single line comment, we used to break it even when it didn't exceed column
limit. This is a temporary solution, in the future we may want to support this
case completely - at least adjust leading whitespace when changing indentation
of the first line.

Reviewers: djasper

Reviewed By: djasper

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

llvm-svn: 186456

11 years agoclang-format: Improve handling of unterminated string literals.
Daniel Jasper [Tue, 16 Jul 2013 20:28:33 +0000 (20:28 +0000)]
clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

llvm-svn: 186454

11 years agoUpdate the examples for an API change.
Rafael Espindola [Tue, 16 Jul 2013 20:22:35 +0000 (20:22 +0000)]
Update the examples for an API change.

llvm-svn: 186453

11 years agoFix crash on complex constant zero.
Eli Friedman [Tue, 16 Jul 2013 20:19:04 +0000 (20:19 +0000)]
Fix crash on complex constant zero.

Fixes <rdar://problem/14442543>.

llvm-svn: 186452

11 years agoFix the build with clang and libstdc++4.7.
Rafael Espindola [Tue, 16 Jul 2013 20:18:13 +0000 (20:18 +0000)]
Fix the build with clang and libstdc++4.7.

llvm-svn: 186451

11 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 16 Jul 2013 19:44:30 +0000 (19:44 +0000)]
Update for llvm API change.

llvm-svn: 186450

11 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 16 Jul 2013 19:44:28 +0000 (19:44 +0000)]
Update for llvm API change.

llvm-svn: 186449

11 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 16 Jul 2013 19:44:23 +0000 (19:44 +0000)]
Update for llvm API change.

llvm-svn: 186448

11 years agoAdd a wrapper for open.
Rafael Espindola [Tue, 16 Jul 2013 19:44:17 +0000 (19:44 +0000)]
Add a wrapper for open.

This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447

11 years agoAdd tests for 'thread step out' for multithreaded programs
Daniel Malea [Tue, 16 Jul 2013 19:41:37 +0000 (19:41 +0000)]
Add tests for 'thread step out' for multithreaded programs
- test with python API
- test with command interpreter
- test stepping a single (selected) thread
- test stepping all threads in the program

llvm-svn: 186446

11 years agoFinally, force the target for this test. Should unbreak non-x86 buildbots.
Benjamin Kramer [Tue, 16 Jul 2013 19:22:07 +0000 (19:22 +0000)]
Finally, force the target for this test. Should unbreak non-x86 buildbots.

llvm-svn: 186445

11 years agoXFAIL this test on mingw.
Rafael Espindola [Tue, 16 Jul 2013 19:20:29 +0000 (19:20 +0000)]
XFAIL this test on mingw.

llvm-svn: 186444

11 years agoObjectiveC migration: complete migrating class
Fariborz Jahanian [Tue, 16 Jul 2013 18:58:41 +0000 (18:58 +0000)]
ObjectiveC migration: complete migrating class
declaration to include list of protocols class
conforms to.

llvm-svn: 186443

11 years agoLabel names also differ between platforms. Use a relaxed regex.
Benjamin Kramer [Tue, 16 Jul 2013 18:54:21 +0000 (18:54 +0000)]
Label names also differ between platforms. Use a relaxed regex.

llvm-svn: 186442

11 years agobuild lld unittests as part of lld-test target
Nick Kledzik [Tue, 16 Jul 2013 18:46:48 +0000 (18:46 +0000)]
build lld unittests as part of lld-test target

llvm-svn: 186441

11 years agoFix Driver tests to check return value of parse(), simplify subclassing, and remove...
Nick Kledzik [Tue, 16 Jul 2013 18:45:57 +0000 (18:45 +0000)]
Fix Driver tests to check return value of parse(), simplify subclassing, and remove unneeded instance variables

llvm-svn: 186440

11 years agoFix test not to fail when the target doesn't use leading underscores on symbols.
Benjamin Kramer [Tue, 16 Jul 2013 18:42:01 +0000 (18:42 +0000)]
Fix test not to fail when the target doesn't use leading underscores on symbols.

llvm-svn: 186439

11 years agoFileCheckize test/Driver/immediate-options.c
Hans Wennborg [Tue, 16 Jul 2013 18:27:29 +0000 (18:27 +0000)]
FileCheckize test/Driver/immediate-options.c

llvm-svn: 186438

11 years agoFix formatting. No functional change.
Craig Topper [Tue, 16 Jul 2013 18:27:27 +0000 (18:27 +0000)]
Fix formatting. No functional change.

llvm-svn: 186437

11 years agoCleanup testing case by using a shorter name for types.
Manman Ren [Tue, 16 Jul 2013 18:26:48 +0000 (18:26 +0000)]
Cleanup testing case by using a shorter name for types.

llvm-svn: 186436

11 years agoRemove floats from live range splitting costs.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:18 +0000 (18:26 +0000)]
Remove floats from live range splitting costs.

These floats all represented block frequencies anyway, so just use the
BlockFrequency class directly.

Some floating point computations remain in tryLocalSplit(). They are
estimating spill weights which are still floats.

llvm-svn: 186435

11 years agoReapply r185393.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)]
Reapply r185393.

Original commit message:

Remove floating point computations from SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

llvm-svn: 186434

11 years agoRevamp the formatting of C++11 braced init lists.
Daniel Jasper [Tue, 16 Jul 2013 18:22:10 +0000 (18:22 +0000)]
Revamp the formatting of C++11 braced init lists.

The fundamental concept is:
Format as if the braced init list was a function call (with parentheses
replaced by braces). If there is no name/type before the opening brace
(e.g. if the braced list is nested), assume a zero-length identifier
just before the opening brace.

This behavior is gated on a new style flag, which for now replaces the
SpacesInBracedLists style flag. Activate this style flag for Google
style to reflect recent style guide changes.

llvm-svn: 186433

11 years ago[X86] Use min/max to optimze unsigend vector comparison on X86
Juergen Ributzka [Tue, 16 Jul 2013 18:20:45 +0000 (18:20 +0000)]
[X86] Use min/max to optimze unsigend vector comparison on X86

Use PMIN/PMAX for UGE/ULE vector comparions to reduce the number of required
instructions. This trick also works for UGT/ULT, but there is no advantage in
doing so. It wouldn't reduce the number of instructions and it would actually
reduce performance.

Reviewer: Ben

radar:5972691

llvm-svn: 186432

11 years agoMake SpecialCaseList match full strings, as documented, using anchors.
Peter Collingbourne [Tue, 16 Jul 2013 17:56:07 +0000 (17:56 +0000)]
Make SpecialCaseList match full strings, as documented, using anchors.

Differential Revision: http://llvm-reviews.chandlerc.com/D1149

llvm-svn: 186431

11 years agoBug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pa...
Marshall Clow [Tue, 16 Jul 2013 17:45:44 +0000 (17:45 +0000)]
Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr.

llvm-svn: 186430

11 years agoTest commit to verify write access.
Juergen Ributzka [Tue, 16 Jul 2013 17:44:23 +0000 (17:44 +0000)]
Test commit to verify write access.

llvm-svn: 186429

11 years ago[WinLink] Add /LargeAddressAware command line option.
Rui Ueyama [Tue, 16 Jul 2013 17:20:38 +0000 (17:20 +0000)]
[WinLink] Add /LargeAddressAware command line option.

llvm-svn: 186428

11 years agoFix broken unittest for GnuLDDriver.
Rui Ueyama [Tue, 16 Jul 2013 17:17:01 +0000 (17:17 +0000)]
Fix broken unittest for GnuLDDriver.

llvm-svn: 186427

11 years ago[Support] Add a Unicode conversion wrapper from UTF16 to UTF8
Reid Kleckner [Tue, 16 Jul 2013 17:14:33 +0000 (17:14 +0000)]
[Support] Add a Unicode conversion wrapper from UTF16 to UTF8

This is to support parsing UTF16 response files in LLVM/lib/Option for
lld and clang.

Reviewers: hans

Differential Revision: http://llvm-reviews.chandlerc.com/D1138

llvm-svn: 186426

11 years agoWhen the inliner merges allocas, it must keep the larger alignment
Hal Finkel [Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)]
When the inliner merges allocas, it must keep the larger alignment

For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.

I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.

llvm-svn: 186425

11 years agotsan: extend suppressions format with ^ and $ symbols
Dmitry Vyukov [Tue, 16 Jul 2013 16:44:15 +0000 (16:44 +0000)]
tsan: extend suppressions format with ^ and $ symbols
not it's possible to write more precise suppressions,
e.g. "^foo$" won't match "blafoobar"

llvm-svn: 186424

11 years agoOn error, close the temporary file descriptor.
Rafael Espindola [Tue, 16 Jul 2013 16:00:32 +0000 (16:00 +0000)]
On error, close the temporary file descriptor.

With this change llvm-ar can remove the temporary file on windows too.

llvm-svn: 186423

11 years agoAdd more types to ASTNodeKind. Refactor common instantiation code.
Samuel Benzaquen [Tue, 16 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Add more types to ASTNodeKind. Refactor common instantiation code.

Summary:
Add support for CXXCtorInitializer and TemplateArgument types to ASTNodeKind.
This change is to support more matchers from clang/ASTMatchers/ASTMatchers.h in the dynamic layer (clang/ASTMatchers/Dynamic).

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1143

llvm-svn: 186422

11 years agoThis patch removes unused parameter allProperties and converts remaining
Fariborz Jahanian [Tue, 16 Jul 2013 15:33:19 +0000 (15:33 +0000)]
This patch removes unused parameter allProperties and converts remaining
parameters in ArrayRef'ize Sema::ActOnAtEnd  to ArrayRef.
Patch by Robert Wilhelm.

llvm-svn: 186421

11 years agoSLPVectorizer: Reduce the compile time of the consecutive store lookup.
Nadav Rotem [Tue, 16 Jul 2013 15:25:17 +0000 (15:25 +0000)]
SLPVectorizer: Reduce the compile time of the consecutive store lookup.

Process groups of stores in chunks of 16.

llvm-svn: 186420

11 years agoEnsure a correct order between memory accesses.
Hongbin Zheng [Tue, 16 Jul 2013 15:20:29 +0000 (15:20 +0000)]
Ensure a correct order between memory accesses.

Ensure that the scalar write access corresponds to the result of a load
instruction appears after the generic read access corresponds to the load
instruction.

llvm-svn: 186419

11 years agoIndependentBlock: Add option to disable scalar to array rewriting.
Hongbin Zheng [Tue, 16 Jul 2013 15:19:33 +0000 (15:19 +0000)]
IndependentBlock: Add option to disable scalar to array rewriting.

llvm-svn: 186418

11 years agoMake sure the each instruction is mapped to one memory access.
Hongbin Zheng [Tue, 16 Jul 2013 15:18:51 +0000 (15:18 +0000)]
Make sure the each instruction is mapped to one memory access.

llvm-svn: 186417

11 years agoFix and re-enable R600 vload/vstore assembly
Aaron Watry [Tue, 16 Jul 2013 14:29:01 +0000 (14:29 +0000)]
Fix and re-enable R600 vload/vstore assembly

The assembly optimizations were making unsafe assumptions about which address
spaces had which identifiers.

Also, fix vload/vstore with 64-bit pointers. This was broken previously on
Radeon SI.

This version still only has assembly versions of int/uint 2/4/8/16 for global
loads and stores on R600, but it does it in a way that would be very easily
extended to private/local/constant and could also be handled easily on other
architectures.

v2: 1) Leave v[load|store]_impl.ll in generic/lib
    2) Remove vload_if.ll and vstore_if.ll interfaces
    3) Fix address+offset calculations
    3) Remove offset from assembly arg list
llvm-svn: 186416

11 years agolibclc: vload/vstore disable assembly and fix offset calculation
Aaron Watry [Tue, 16 Jul 2013 14:28:58 +0000 (14:28 +0000)]
libclc: vload/vstore disable assembly and fix offset calculation

This commit gets us back to pure CLC and fixes offset calculations.

The next commit will re-enable the assembly implementation for R600,
fix bugs related to 64-bit address spaces, and also fix the
incorrect assumption that address space identifiers are the same in
all architectures.

llvm-svn: 186415

11 years agoCreate files with mode 666. This matches the behavior of other unix tools.
Rafael Espindola [Tue, 16 Jul 2013 14:10:07 +0000 (14:10 +0000)]
Create files with mode 666. This matches the behavior of other unix tools.

llvm-svn: 186414

11 years ago[Support] Fix some warnings when self-hosting clang on Windows
Reid Kleckner [Tue, 16 Jul 2013 14:04:08 +0000 (14:04 +0000)]
[Support] Fix some warnings when self-hosting clang on Windows

llvm-svn: 186413

11 years agoRemove unnecessary assignment.
Manuel Klimek [Tue, 16 Jul 2013 13:58:44 +0000 (13:58 +0000)]
Remove unnecessary assignment.

llvm-svn: 186412

11 years agoFixes another hard to test problem with iterator invalidation.
Manuel Klimek [Tue, 16 Jul 2013 13:20:30 +0000 (13:20 +0000)]
Fixes another hard to test problem with iterator invalidation.

As every match call can recursively call back into the memoized match
via a nested traversal matcher (for example:
stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))),
and every memoization step might clear the cache, we must not store
iterators into the result cache when calling match on a submatcher.

llvm-svn: 186411

11 years ago[ASan] Bump min supported Mac OS X version to 10.6 - makefile build
Alexey Samsonov [Tue, 16 Jul 2013 13:16:15 +0000 (13:16 +0000)]
[ASan] Bump min supported Mac OS X version to 10.6 - makefile build

llvm-svn: 186410

11 years ago[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation
Ulrich Weigand [Tue, 16 Jul 2013 13:03:25 +0000 (13:03 +0000)]
[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation

When truncating to a format with fewer mantissa bits, APFloat::convert
will perform a right shift of the mantissa by the difference of the
precision of the two formats.  Usually, this will result in just the
mantissa bits needed for the target format.

One special situation is if the input number is denormal.  In this case,
the right shift may discard significant bits.  This is usually not a
problem, since truncating a denormal usually results in zero (underflow)
after normalization anyway, since the result format's exponent range is
usually smaller than the target format's.

However, there is one case where the latter property does not hold:
when truncating from ppc_fp128 to double.  In particular, truncating
a ppc_fp128 whose first double of the pair is denormal should result
in just that first double, not zero.  The current code however
performs an excessive right shift, resulting in lost result bits.
This is then caught in the APFloat::normalize call performed by
APFloat::convert and causes an assertion failure.

This patch checks for the scenario of truncating a denormal, and
attempts to (possibly partially) replace the initial mantissa
right shift by decrementing the exponent, if doing so will still
result in a valid *target format* exponent.

Index: test/CodeGen/PowerPC/pr16573.ll
===================================================================
--- test/CodeGen/PowerPC/pr16573.ll (revision 0)
+++ test/CodeGen/PowerPC/pr16573.ll (revision 0)
@@ -0,0 +1,11 @@
+; RUN: llc < %s | FileCheck %s
+
+target triple = "powerpc64-unknown-linux-gnu"
+
+define double @test() {
+  %1 = fptrunc ppc_fp128 0xM818F2887B9295809800000000032D000 to double
+  ret double %1
+}
+
+; CHECK: .quad -9111018957755033591
+
Index: lib/Support/APFloat.cpp
===================================================================
--- lib/Support/APFloat.cpp (revision 185817)
+++ lib/Support/APFloat.cpp (working copy)
@@ -1956,6 +1956,23 @@
     X86SpecialNan = true;
   }

+  // If this is a truncation of a denormal number, and the target semantics
+  // has larger exponent range than the source semantics (this can happen
+  // when truncating from PowerPC double-double to double format), the
+  // right shift could lose result mantissa bits.  Adjust exponent instead
+  // of performing excessive shift.
+  if (shift < 0 && isFiniteNonZero()) {
+    int exponentChange = significandMSB() + 1 - fromSemantics.precision;
+    if (exponent + exponentChange < toSemantics.minExponent)
+      exponentChange = toSemantics.minExponent - exponent;
+    if (exponentChange < shift)
+      exponentChange = shift;
+    if (exponentChange < 0) {
+      shift -= exponentChange;
+      exponent += exponentChange;
+    }
+  }
+
   // If this is a truncation, perform the shift before we narrow the storage.
   if (shift < 0 && (isFiniteNonZero() || category==fcNaN))
     lostFraction = shiftRight(significandParts(), oldPartCount, -shift);

llvm-svn: 186409

11 years ago[Sanitizer] move strcpy and strncpy to common interceptors
Alexey Samsonov [Tue, 16 Jul 2013 12:51:53 +0000 (12:51 +0000)]
[Sanitizer] move strcpy and strncpy to common interceptors

llvm-svn: 186408

11 years ago[XCore] Fix printing of inline asm operands.
Richard Osborne [Tue, 16 Jul 2013 12:48:34 +0000 (12:48 +0000)]
[XCore] Fix printing of inline asm operands.

Previously an asm operand with no operand modifier would give the error
"invalid operand in inline asm".

llvm-svn: 186407

11 years agoARM: allow printing of ARM atomic DAG nodes.
Tim Northover [Tue, 16 Jul 2013 12:15:36 +0000 (12:15 +0000)]
ARM: allow printing of ARM atomic DAG nodes.

We'd forgotten to provide string representations for the special ARMISD atomic
nodes; this adds them in. No effect on CodeGen, just makes the output of
"-view-whatever-dags" slightly more readable.

llvm-svn: 186406

11 years ago[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes
Richard Sandiford [Tue, 16 Jul 2013 11:55:57 +0000 (11:55 +0000)]
[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes

llvm-svn: 186405

11 years ago[ASan] Bump min supported Mac OS X version to 10.6
Alexey Samsonov [Tue, 16 Jul 2013 11:54:40 +0000 (11:54 +0000)]
[ASan] Bump min supported Mac OS X version to 10.6

llvm-svn: 186404

11 years agoFixing a buildbot failure:unused function.
Vladimir Medic [Tue, 16 Jul 2013 11:43:20 +0000 (11:43 +0000)]
Fixing a buildbot failure:unused function.

llvm-svn: 186403

11 years agoclang-format: Improve detection of function types.
Daniel Jasper [Tue, 16 Jul 2013 11:37:21 +0000 (11:37 +0000)]
clang-format: Improve detection of function types.

This fixes an incorrect detection that led to a formatting error.
Before:
  some_var = function (*some_pointer_var)[0];
After:
  some_var = function(*some_pointer_var)[0];

llvm-svn: 186402

11 years ago[SystemZ] Add MC support for R[NOX]SBG
Richard Sandiford [Tue, 16 Jul 2013 11:28:08 +0000 (11:28 +0000)]
[SystemZ] Add MC support for R[NOX]SBG

CodeGen support will come later.

llvm-svn: 186401

11 years agotsan: support sigsuspend() call
Dmitry Vyukov [Tue, 16 Jul 2013 11:28:04 +0000 (11:28 +0000)]
tsan: support sigsuspend() call
Intercepting it makes it process pending signal before return.

llvm-svn: 186400

11 years ago[SystemZ] Use RISBG for (shift (and ...))
Richard Sandiford [Tue, 16 Jul 2013 11:02:24 +0000 (11:02 +0000)]
[SystemZ] Use RISBG for (shift (and ...))

Another patch in the series to make more use of R.SBG.  This one extends
r186072 and r186073 to handle cases where the AND is inside the shift.

llvm-svn: 186399

11 years agoFix test on release builds.
Tim Northover [Tue, 16 Jul 2013 10:22:19 +0000 (10:22 +0000)]
Fix test on release builds.

Unfortunately I don't think there's a good way to validate branch targets on
release builds. Fortunately it's a minor part of this test (and based on
generic code) so I don't mind dropping it.

llvm-svn: 186398

11 years ago This patch represents Mips utilization of r186388 code that alows asm matcher to...
Vladimir Medic [Tue, 16 Jul 2013 10:07:14 +0000 (10:07 +0000)]
 This patch represents Mips utilization of r186388 code that alows asm matcher to emit mnemonics contain '.' characters. This makes asm parser code simpler and more efficient.

llvm-svn: 186397

11 years agoPPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.
NAKAMURA Takumi [Tue, 16 Jul 2013 09:59:51 +0000 (09:59 +0000)]
PPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.

    g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

llvm-svn: 186396

11 years agoARM: implement low-level intrinsics for the atomic exclusive operations.
Tim Northover [Tue, 16 Jul 2013 09:47:53 +0000 (09:47 +0000)]
ARM: implement low-level intrinsics for the atomic exclusive operations.

This adds three overloaded intrinsics to Clang:
    T __builtin_arm_ldrex(const volatile T *addr)
    int __builtin_arm_strex(T val, volatile T *addr)
    void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

llvm-svn: 186394