platform/upstream/llvm.git
11 years agoSimplify git-clang-format by using new -lines option.
Daniel Jasper [Thu, 1 Aug 2013 18:17:13 +0000 (18:17 +0000)]
Simplify git-clang-format by using new -lines option.

Patch by Mark Lodato. Thank you!

llvm-svn: 187592

11 years agoPass -G argument to cmake with the same generator's name as used for the
Simon Atanasyan [Thu, 1 Aug 2013 18:04:07 +0000 (18:04 +0000)]
Pass -G argument to cmake with the same generator's name as used for the
initial cmake invocation.

Patch reviewed by Reid Kleckner.

llvm-svn: 187591

11 years agoAllow test categories to be skipped.
Stefanus Du Toit [Thu, 1 Aug 2013 17:59:20 +0000 (17:59 +0000)]
Allow test categories to be skipped.

This adds a new parameter, --skip-category, that can be used to list
categories that should be skipped. For example, to run all tests except for
Objective-C ones, one can now write:

  ./dotest.py --skip-category objc [...]

llvm-svn: 187590

11 years agoTeach clang-format to understand static_asserts better.
Daniel Jasper [Thu, 1 Aug 2013 17:58:23 +0000 (17:58 +0000)]
Teach clang-format to understand static_asserts better.

Before:
  template <bool B, bool C>
  class A {
    static_assert(B &&C, "Something is wrong");
  };

After:
  template <bool B, bool C>
  class A {
    static_assert(B && C, "Something is wrong");
  };

(Note the spacing around '&&'). Also change the identifier table to always
understand all C++11 keywords (which seems like the right thing to do).

llvm-svn: 187589

11 years agoFix typo in comment.
Joey Gouly [Thu, 1 Aug 2013 17:54:08 +0000 (17:54 +0000)]
Fix typo in comment.

Thanks Artyom Skrobov!

llvm-svn: 187588

11 years agoTaking another swing at correctly optimizing fill_n.
Howard Hinnant [Thu, 1 Aug 2013 17:29:28 +0000 (17:29 +0000)]
Taking another swing at correctly optimizing fill_n.

llvm-svn: 187587

11 years agoAST: Treat inline function declarations in -fms-compatibility as if it were in C...
David Majnemer [Thu, 1 Aug 2013 17:26:42 +0000 (17:26 +0000)]
AST: Treat inline function declarations in -fms-compatibility as if it were in C++ when in C mode

This essentially fixes PR16766.

llvm-svn: 187586

11 years agoUpdate failing tests on Linux for clang and gcc to only fail on Linux instead of...
Matt Kopec [Thu, 1 Aug 2013 17:22:24 +0000 (17:22 +0000)]
Update failing tests on Linux for clang and gcc to only fail on Linux instead of all platforms.

Thanks Stefanus!

llvm-svn: 187585

11 years agoremove executable permission from IntrinsicsXCore.td
Robert Lytton [Thu, 1 Aug 2013 17:17:59 +0000 (17:17 +0000)]
remove executable permission from IntrinsicsXCore.td

llvm-svn: 187584

11 years agoOptions: Use AliasArgs for -O -> -O2 translation.
Hans Wennborg [Thu, 1 Aug 2013 16:21:57 +0000 (16:21 +0000)]
Options: Use AliasArgs for -O -> -O2 translation.

This way we can do the translation in the .td file rather than manually.

llvm-svn: 187583

11 years agoR600: Add 64-bit float load/store support
Tom Stellard [Thu, 1 Aug 2013 15:23:42 +0000 (15:23 +0000)]
R600: Add 64-bit float load/store support

* Added R600_Reg64 class
* Added T#Index#.XY registers definition
* Added v2i32 register reads from parameter and global space
* Added f32 and i32 elements extraction from v2f32 and v2i32
* Added v2i32 -> v2f32 conversions

Tom Stellard:
  - Mark vec2 operations as expand.  The addition of a vec2 register
    class made them all legal.

Patch by: Dmitry Cherkassov

Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
llvm-svn: 187582

11 years agoR600: Use 64-bit alignment for 64-bit kernel arguments
Tom Stellard [Thu, 1 Aug 2013 15:23:31 +0000 (15:23 +0000)]
R600: Use 64-bit alignment for 64-bit kernel arguments

llvm-svn: 187581

11 years agoR600/SI: Custom lower i64 ZERO_EXTEND
Tom Stellard [Thu, 1 Aug 2013 15:23:26 +0000 (15:23 +0000)]
R600/SI: Custom lower i64 ZERO_EXTEND

llvm-svn: 187580

11 years ago[lsan] Add leak_check_at_exit flag.
Sergey Matveev [Thu, 1 Aug 2013 14:57:07 +0000 (14:57 +0000)]
[lsan] Add leak_check_at_exit flag.

We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.

llvm-svn: 187578

11 years agoclang-format: Improve line breaks in @property.
Daniel Jasper [Thu, 1 Aug 2013 13:46:58 +0000 (13:46 +0000)]
clang-format: Improve line breaks in @property.

Before:
  @property(nonatomic, assign,
            readonly) NSString *looooooooooooooooooooooooooooongName;

After:
  @property(nonatomic, assign, readonly)
      NSString *looooooooooooooooooooooooooooongName;

llvm-svn: 187577

11 years agoEVEX and compressed displacement encoding for AVX512
Elena Demikhovsky [Thu, 1 Aug 2013 13:34:06 +0000 (13:34 +0000)]
EVEX and compressed displacement encoding for AVX512

llvm-svn: 187576

11 years ago[msan] Intercept setenv, putenv.
Evgeniy Stepanov [Thu, 1 Aug 2013 11:14:14 +0000 (11:14 +0000)]
[msan] Intercept setenv, putenv.

llvm-svn: 187575

11 years agoMake helper function static.
Benjamin Kramer [Thu, 1 Aug 2013 11:08:06 +0000 (11:08 +0000)]
Make helper function static.

llvm-svn: 187574

11 years ago[SystemZ] Reuse CC results for integer comparisons with zero
Richard Sandiford [Thu, 1 Aug 2013 10:39:40 +0000 (10:39 +0000)]
[SystemZ] Reuse CC results for integer comparisons with zero

This also fixes a bug in the predication of LR to LOCR: I'd forgotten
that with these in-place instruction builds, the implicit operands need
to be added manually.  I think this was latent until now, but is tested
by int-cmp-45.c.  It also adds a CC valid mask to STOC, again tested by
int-cmp-45.c.

llvm-svn: 187573

11 years agoSilence unused variable warning in non-assert builds.
Daniel Jasper [Thu, 1 Aug 2013 10:30:11 +0000 (10:30 +0000)]
Silence unused variable warning in non-assert builds.

llvm-svn: 187572

11 years ago[SystemZ] Prefer comparisons with zero
Richard Sandiford [Thu, 1 Aug 2013 10:29:45 +0000 (10:29 +0000)]
[SystemZ] Prefer comparisons with zero

Convert >= 1 to > 0, etc.  Using comparison with zero isn't a win on its own,
but it exposes more opportunities for CC reuse (the next patch).

llvm-svn: 187571

11 years agoAdd tests for Mips DSP instructions.
Vladimir Medic [Thu, 1 Aug 2013 09:35:25 +0000 (09:35 +0000)]
Add tests for Mips DSP instructions.

llvm-svn: 187570

11 years agoMoving definition of MnemonicContainsDot field from class Instruction to class AsmPar...
Vladimir Medic [Thu, 1 Aug 2013 09:25:27 +0000 (09:25 +0000)]
Moving definition of MnemonicContainsDot field from class Instruction to class AsmParser as suggested.

llvm-svn: 187569

11 years agoAArch64: initial NEON support
Tim Northover [Thu, 1 Aug 2013 09:23:19 +0000 (09:23 +0000)]
AArch64: initial NEON support

Patch by Ana Pazos

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

llvm-svn: 187568

11 years agoAArch64: add initial NEON support
Tim Northover [Thu, 1 Aug 2013 09:20:35 +0000 (09:20 +0000)]
AArch64: add initial NEON support

Patch by Ana Pazos.

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

llvm-svn: 187567

11 years agoXCore target: add GCCBuiltin to four intrinsics
Robert Lytton [Thu, 1 Aug 2013 08:41:32 +0000 (08:41 +0000)]
XCore target: add GCCBuiltin to four intrinsics

The following are made available by clang in the XCore ABI
__builtin_bitrev
__builtin_getid
__builtin_getps
__builtin_setps

llvm-svn: 187566

11 years agoXCore target: Fix Vararg handling
Robert Lytton [Thu, 1 Aug 2013 08:29:44 +0000 (08:29 +0000)]
XCore target: Fix Vararg handling

llvm-svn: 187565

11 years agoCheck dynamic_cast is not used with -fno-rtti, unless it is a noop or can be resolved...
Arnaud A. de Grandmaison [Thu, 1 Aug 2013 08:28:32 +0000 (08:28 +0000)]
Check dynamic_cast is not used with -fno-rtti, unless it is a noop or can be resolved statically.

llvm-svn: 187564

11 years agoXCore target: Add byval handling
Robert Lytton [Thu, 1 Aug 2013 08:18:55 +0000 (08:18 +0000)]
XCore target: Add byval handling

llvm-svn: 187563

11 years agoXcore target
Robert Lytton [Thu, 1 Aug 2013 07:52:05 +0000 (07:52 +0000)]
Xcore target
Fix emitArrayBound() calling OutStreamer.Emit*() multiple times when trying to print a single line

llvm-svn: 187562

11 years agoRemove more odd code that tries to account for an off by 1 problem in vec3 shuffles...
Craig Topper [Thu, 1 Aug 2013 06:59:29 +0000 (06:59 +0000)]
Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist.

llvm-svn: 187561

11 years agoFix to handle all non-power-of-2 vector sizes in the mask form of _builtin_shuffle_ve...
Craig Topper [Thu, 1 Aug 2013 06:42:40 +0000 (06:42 +0000)]
Fix to handle all non-power-of-2 vector sizes in the mask form of _builtin_shuffle_vector.

Previously a 2-bit mask was used to mask each element of a vec6 mask before doing the extracts instead of 3-bit mask necessary to cover 0-5. vec3 was the only non-power-of-2 that worked correctly because a +1 conditionally added before calculating floor(log2(elements)).

llvm-svn: 187560

11 years agoSema: Diagnose explicitly bound unresolved member expressions decaying into pointers...
David Majnemer [Thu, 1 Aug 2013 06:13:59 +0000 (06:13 +0000)]
Sema: Diagnose explicitly bound unresolved member expressions decaying into pointers to function type

We would disallow the case where the overloaded member expression is
coming from an address-of operator but we wouldn't issue any diagnostics
when the overloaded member expression comes by way of a function to
pointer decay cast.

Clang's implementation of DR61 is now seemingly complete.

llvm-svn: 187559

11 years agoRemove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.
Craig Topper [Thu, 1 Aug 2013 04:51:48 +0000 (04:51 +0000)]
Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.

llvm-svn: 187558

11 years agoParse: Don't consider attributes of broken member declarators
David Majnemer [Thu, 1 Aug 2013 04:22:55 +0000 (04:22 +0000)]
Parse: Don't consider attributes of broken member declarators

ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.

However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.

While we are here, clean up the code a bit.

Fixes PR16765

llvm-svn: 187557

11 years agoFix assert when instantiating a default argument of a template defined in a
Richard Smith [Thu, 1 Aug 2013 04:12:04 +0000 (04:12 +0000)]
Fix assert when instantiating a default argument of a template defined in a
module.

llvm-svn: 187556

11 years agoFix some misc. issues with Mips16 fp stubs.
Reed Kotler [Thu, 1 Aug 2013 02:26:31 +0000 (02:26 +0000)]
Fix some misc. issues with Mips16 fp stubs.
1) They should never be inlined.
2) A naming inconsistency with gcc mips16
3) Stubs should not have the global attribute

llvm-svn: 187555

11 years agoFormatting.
Eric Christopher [Thu, 1 Aug 2013 01:38:16 +0000 (01:38 +0000)]
Formatting.

llvm-svn: 187554

11 years agoAdd an omitted IsCall=1.
Reed Kotler [Thu, 1 Aug 2013 00:59:06 +0000 (00:59 +0000)]
Add an omitted IsCall=1.

llvm-svn: 187553

11 years agoConstrain fill_n -> memset operations to include implicit convertibility to unsigned...
Howard Hinnant [Thu, 1 Aug 2013 00:41:55 +0000 (00:41 +0000)]
Constrain fill_n -> memset operations to include implicit convertibility to unsigned char.  This fixes llvm.org/bugs/show_bug.cgi?id=16764.  Also a drive-by fix on a chrono test suite bug.

llvm-svn: 187552

11 years agoRemove the SUPPORT_ALIASARGS define
Hans Wennborg [Thu, 1 Aug 2013 00:12:38 +0000 (00:12 +0000)]
Remove the SUPPORT_ALIASARGS define

It is not needed after LLVM r187546.

llvm-svn: 187551

11 years agoRemove the SUPPORT_ALIASARGS define
Hans Wennborg [Thu, 1 Aug 2013 00:12:13 +0000 (00:12 +0000)]
Remove the SUPPORT_ALIASARGS define

It is not needed after LLVM r187546.

llvm-svn: 187550

11 years agoclang-format: Make alignment of trailing comments optional ..
Daniel Jasper [Wed, 31 Jul 2013 23:55:15 +0000 (23:55 +0000)]
clang-format: Make alignment of trailing comments optional ..

.. in order to support WebKit style properly.

llvm-svn: 187549

11 years agoUse StringRef::equals_lower(). No functionality change.
Rui Ueyama [Wed, 31 Jul 2013 23:53:58 +0000 (23:53 +0000)]
Use StringRef::equals_lower(). No functionality change.

llvm-svn: 187548

11 years agoMake -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td file
Hans Wennborg [Wed, 31 Jul 2013 23:39:13 +0000 (23:39 +0000)]
Make -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td file

This way we don't have to translate it manually in Clang::ConstructJob.

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

llvm-svn: 187547

11 years agoOption parsing: remove non-SUPPORT_ALIASARGS fall-back
Hans Wennborg [Wed, 31 Jul 2013 23:28:51 +0000 (23:28 +0000)]
Option parsing: remove non-SUPPORT_ALIASARGS fall-back

The clients of this code have been updated to all support AliasArgs.

This depends on Clang r187538 and lld r187541.

llvm-svn: 187546

11 years agoFix thread name updating in Linux. "thread list" should report correct names always...
Michael Sartain [Wed, 31 Jul 2013 23:27:46 +0000 (23:27 +0000)]
Fix thread name updating in Linux. "thread list" should report correct names always now.
Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs
Removed several un-needed set thread name calls

CR (and multiple suggestions): mkopec

llvm-svn: 187545

11 years ago[PECOFF][Driver] Prefer "/" over "-" as the indicator of the option.
Rui Ueyama [Wed, 31 Jul 2013 23:23:25 +0000 (23:23 +0000)]
[PECOFF][Driver] Prefer "/" over "-" as the indicator of the option.

This patch does not change the behavior of LLD, but changes the output of the
help text. We want to show the help text with Windows style indicator rather
than Unix style indicator.

llvm-svn: 187544

11 years agoObjectiveC ARC: finishing off issuing error when
Fariborz Jahanian [Wed, 31 Jul 2013 23:19:34 +0000 (23:19 +0000)]
ObjectiveC ARC: finishing off issuing error when
retainable pointer is passed to an audited CF function
expecting CF type. // rdar://14569171

llvm-svn: 187543

11 years agoOptimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.
Michael Sartain [Wed, 31 Jul 2013 23:19:14 +0000 (23:19 +0000)]
Optimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.

CR: mkopec
llvm-svn: 187542

11 years agoOption parsing tables: pick up AliasArgs from the OPTION macro.
Hans Wennborg [Wed, 31 Jul 2013 23:17:41 +0000 (23:17 +0000)]
Option parsing tables: pick up AliasArgs from the OPTION macro.

This depends on LLVM r187537.

The SUPPORT_ALIASARGS macro will be removed once all option parsing
clients have been updated.

llvm-svn: 187541

11 years agoclang-format: Add more options to namespace indentation.
Daniel Jasper [Wed, 31 Jul 2013 23:16:02 +0000 (23:16 +0000)]
clang-format: Add more options to namespace indentation.

With this patch, clang-format can be configured to:
* not indent in namespace at all (former behavior).
* indent in namespace as in other blocks.
* indent only in inner namespaces (as required by WebKit style).

Also fix alignment of access specifiers in WebKit style.

Patch started by Marek Kurdej. Thank you!

llvm-svn: 187540

11 years ago[PECOFF][Driver] Rewrite the tablegen def file using multiclass to remove duplicates.
Rui Ueyama [Wed, 31 Jul 2013 23:12:06 +0000 (23:12 +0000)]
[PECOFF][Driver] Rewrite the tablegen def file using multiclass to remove duplicates.

llvm-svn: 187539

11 years agoOption parsing tables: pick up AliasArgs from the OPTION macro.
Hans Wennborg [Wed, 31 Jul 2013 23:07:21 +0000 (23:07 +0000)]
Option parsing tables: pick up AliasArgs from the OPTION macro.

This depends on LLVM r187537.

The SUPPORT_ALIASARGS macro will be removed once all option parsing
clients have been updated.

llvm-svn: 187538

11 years agoOption parsing: add support for alias arguments.
Hans Wennborg [Wed, 31 Jul 2013 22:44:41 +0000 (22:44 +0000)]
Option parsing: add support for alias arguments.

This makes option aliases more powerful by enabling them to
pass along arguments to the option they're aliasing.

For example, if we have a joined option "-foo=", we can now
specify a flag option "-bar" to be an alias of that, with the
argument "baz".

This is especially useful for the cl.exe compatible clang driver,
where many options are aliases. For example, this patch enables
us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to
"-Werror" (again, -W is a joined option).

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

llvm-svn: 187537

11 years agoRemove dead #includes.
Hans Wennborg [Wed, 31 Jul 2013 22:28:46 +0000 (22:28 +0000)]
Remove dead #includes.

llvm-svn: 187536

11 years ago80-col
Nadav Rotem [Wed, 31 Jul 2013 22:17:45 +0000 (22:17 +0000)]
80-col

llvm-svn: 187535

11 years agoRevert "[PECOFF][Driver] Remove quotes from command line arguments."
Rui Ueyama [Wed, 31 Jul 2013 22:13:15 +0000 (22:13 +0000)]
Revert "[PECOFF][Driver] Remove quotes from command line arguments."

This reverts commit r187390 because we should not handle argv's quotes ourselves.

In Windows, unlike Unix, quotes are not processed by the shell. Instead the C
startup routine parses it as described in
http://msdn.microsoft.com/en-us/library/a1y7w461.aspx and pass the results to
main(). So, at the time when the control reaches main(), quotes that should be
removed has already been removed.

We still need to handle quotes in the response file and in .drectve section
ourselves. That will be addressed in different patches.

llvm-svn: 187534

11 years agoMark some tests as explicitly failing on clang/gcc as they pass on icc.
Matt Kopec [Wed, 31 Jul 2013 21:52:25 +0000 (21:52 +0000)]
Mark some tests as explicitly failing on clang/gcc as they pass on icc.
Also, rework the signed types test to check for signed or char type in the output as char is signed by default.

llvm-svn: 187533

11 years agoObjectiveC ARC: Do not issue bridge cast diagnostic when
Fariborz Jahanian [Wed, 31 Jul 2013 21:40:51 +0000 (21:40 +0000)]
ObjectiveC ARC: Do not issue bridge cast diagnostic when
passing a retainable object arg to a CF audited function
expecting a CF object type. Issue a normal type mismatch
diagnostic. This is wip // rdar://14569171

llvm-svn: 187532

11 years agocomment typo.
Andrew Trick [Wed, 31 Jul 2013 21:05:54 +0000 (21:05 +0000)]
comment typo.

llvm-svn: 187531

11 years agoAdded the B9.3.19 SUBS PC, LR, #imm (Thumb2) system instruction.
Kevin Enderby [Wed, 31 Jul 2013 21:05:30 +0000 (21:05 +0000)]
Added the B9.3.19 SUBS PC, LR, #imm (Thumb2) system instruction.
While the .td entry is nice and all, it takes a pretty gross hack in
ARMAsmParser::ParseInstruction() because of handling of other "subs"
instructions to get it to match.  Ran it by Jim Grosbach and he said it was
about what he expected to make this work given the existing code.

rdar://14214063

llvm-svn: 187530

11 years agoImplement constexpr (n3302) and fix operator *= and /=
Marshall Clow [Wed, 31 Jul 2013 21:02:34 +0000 (21:02 +0000)]
Implement constexpr (n3302) and fix operator *= and /=

llvm-svn: 187529

11 years agoFix declaring class template methods with an attributed typedef
Reid Kleckner [Wed, 31 Jul 2013 21:00:18 +0000 (21:00 +0000)]
Fix declaring class template methods with an attributed typedef

This change unifies the logic for template instantiation of methods and
functions declared with typedefs.

It ensures that SubstFunctionType() always fills the Params out param
with non-null ParmVarDecls or returns null.

Reviewers: rsmith

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

llvm-svn: 187528

11 years agoclang-cl: add the /c, /W0 and /W1 options
Hans Wennborg [Wed, 31 Jul 2013 20:51:53 +0000 (20:51 +0000)]
clang-cl: add the /c, /W0 and /W1 options

This adds a few more clang-cl options. It also exposes two core clang
options to the clang-cl mode: we need to be able to claim --driver_mode
so it doesn't show up as unused in cl mode, and we need -### for tests.

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

llvm-svn: 187527

11 years agoRevert "R600: Non vector only instruction can be scheduled on trans unit"
Tom Stellard [Wed, 31 Jul 2013 20:43:27 +0000 (20:43 +0000)]
Revert "R600: Non vector only instruction can be scheduled on trans unit"

This reverts commit 98ce62780ea7185ba710868bf83c8077e8d7f6d6.

llvm-svn: 187526

11 years agoRevert "TableGen: Enumerate Schedule Model too."
Tom Stellard [Wed, 31 Jul 2013 20:43:08 +0000 (20:43 +0000)]
Revert "TableGen: Enumerate Schedule Model too."

This reverts commit 2ca1e4a39c7e0d7a00e66ff5437c6d7ace2404a0.

llvm-svn: 187525

11 years agoRevert "R600: Use SchedModel enum for is{Trans,Vector}Only functions"
Tom Stellard [Wed, 31 Jul 2013 20:43:03 +0000 (20:43 +0000)]
Revert "R600: Use SchedModel enum for is{Trans,Vector}Only functions"

This reverts commit 3f1de26cb5cc0543a6a1d71259a7a39d97139051.

llvm-svn: 187524

11 years agoFix lock hierarchy violation in Process (lock ordering of ThreadList mutex and StackF...
Daniel Malea [Wed, 31 Jul 2013 20:21:20 +0000 (20:21 +0000)]
Fix lock hierarchy violation in Process (lock ordering of ThreadList mutex and StackFrameList mutex)
- this fix ensures the ThreadList mutex is always locked before the StackFrameList mutex

Situation where deadlock could occur (without this fix):
Thread 1 is in Process::WillResume and locks the ThreadList mutex (on entry), and subsequently calls StackFrameList::Clear() which locks the StackFrameList mutex.
Meanwhile, thread 2 is in Process::RunThreadPlan and calls Thread::SetSelectedFrame() (which locks the StackFrameList mutex) before calling GetSelectedThread (which attempts to lock the ThreadList mutex)

In my testing on both Linux and Mac OS X, I was unable to reproduce any hangs with this patch applied.

llvm-svn: 187522

11 years agoA few small cleanups to r187504. Thanks to dblaikie for the assist.
Kaelyn Uhrain [Wed, 31 Jul 2013 20:16:17 +0000 (20:16 +0000)]
A few small cleanups to r187504. Thanks to dblaikie for the assist.

llvm-svn: 187521

11 years agoAdd the LD_LIBRARY_PATH to target.env-vars for tests expecting libimf.so when testing...
Matt Kopec [Wed, 31 Jul 2013 20:13:04 +0000 (20:13 +0000)]
Add the LD_LIBRARY_PATH to target.env-vars for tests expecting libimf.so when testing with ICC.

Patch from Andy Kaylor.

llvm-svn: 187520

11 years agoAdds a test for 'target module dump symfile' to the LLDB suite.
Ashok Thirumurthi [Wed, 31 Jul 2013 20:01:04 +0000 (20:01 +0000)]
Adds a test for 'target module dump symfile' to the LLDB suite.

TODO: Improve coverage of SBTypeMember and of 'target module dump'.
llvm-svn: 187519

11 years agoBackwards!
Marshall Clow [Wed, 31 Jul 2013 19:39:37 +0000 (19:39 +0000)]
Backwards!

llvm-svn: 187518

11 years agoImplement n3469 - constexpr for chrono
Marshall Clow [Wed, 31 Jul 2013 19:32:19 +0000 (19:32 +0000)]
Implement n3469 - constexpr for chrono

llvm-svn: 187517

11 years agoR600: Do not mergevector after a vector reg is used
Vincent Lejeune [Wed, 31 Jul 2013 19:32:12 +0000 (19:32 +0000)]
R600: Do not mergevector after a vector reg is used

If we merge vector when a vector is used, it will generate an artificial
antidependency that can prevent 2 tex/vtx instructions to use the same
clause and thus generate extra clauses that reduce performance.

There is no test case as such situation is really hard to predict.

llvm-svn: 187516

11 years agoR600: Avoid more than 4 literals in the same instruction group at scheduling
Vincent Lejeune [Wed, 31 Jul 2013 19:32:07 +0000 (19:32 +0000)]
R600: Avoid more than 4 literals in the same instruction group at scheduling

llvm-svn: 187515

11 years agoR600: Non vector only instruction can be scheduled on trans unit
Vincent Lejeune [Wed, 31 Jul 2013 19:31:56 +0000 (19:31 +0000)]
R600: Non vector only instruction can be scheduled on trans unit

llvm-svn: 187514

11 years agoR600: Don't mix LDS and non-LDS instructions in the same group
Vincent Lejeune [Wed, 31 Jul 2013 19:31:41 +0000 (19:31 +0000)]
R600: Don't mix LDS and non-LDS instructions in the same group

There are a lot of restrictions on instruction groups that contain
LDS instructions, so for now we will be conservative and not packetize
anything else with them.

llvm-svn: 187513

11 years agoR600: Use SchedModel enum for is{Trans,Vector}Only functions
Vincent Lejeune [Wed, 31 Jul 2013 19:31:35 +0000 (19:31 +0000)]
R600: Use SchedModel enum for is{Trans,Vector}Only functions

llvm-svn: 187512

11 years agoTableGen: Enumerate Schedule Model too.
Vincent Lejeune [Wed, 31 Jul 2013 19:31:20 +0000 (19:31 +0000)]
TableGen: Enumerate Schedule Model too.

llvm-svn: 187511

11 years agoR600: Remove predicated_break inst
Vincent Lejeune [Wed, 31 Jul 2013 19:31:14 +0000 (19:31 +0000)]
R600: Remove predicated_break inst

We were using two instructions for similar purpose : break and
predicated break. Only predicated_break was emitted and it was
lowered at R600ControlFlowFinalizer to JUMP;CF_BREAK;POP.
This commit simplify the situation by making AMDILCFGStructurizer
emit IF_PREDICATE;BREAK;ENDIF; instead of predicated_break (which
is now removed).

There is no functionality change.

llvm-svn: 187510

11 years agoObjectiveC arc: minor refactoring in my last patch
Fariborz Jahanian [Wed, 31 Jul 2013 18:39:08 +0000 (18:39 +0000)]
ObjectiveC arc: minor refactoring in my last patch
to avoid future false positives. // rdar://14569171

llvm-svn: 187509

11 years agoObjectiveC arc: Introduce a new initialization kind
Fariborz Jahanian [Wed, 31 Jul 2013 18:21:45 +0000 (18:21 +0000)]
ObjectiveC arc: Introduce a new initialization kind
for parameters passed to CF audited functions
to be used for better diagnostics. Current set but
unused. // rdar://14569171

llvm-svn: 187508

11 years agoMark additional ICC failing tests as expected fail.
Matt Kopec [Wed, 31 Jul 2013 17:56:22 +0000 (17:56 +0000)]
Mark additional ICC failing tests as expected fail.

llvm-svn: 187507

11 years agoReject bitcasts between address spaces with different sizes
Matt Arsenault [Wed, 31 Jul 2013 17:49:08 +0000 (17:49 +0000)]
Reject bitcasts between address spaces with different sizes

llvm-svn: 187506

11 years ago[PECOFF] Add a comment about .bss section.
Rui Ueyama [Wed, 31 Jul 2013 17:45:48 +0000 (17:45 +0000)]
[PECOFF] Add a comment about .bss section.

llvm-svn: 187505

11 years agoImprove the diagnostic experience, including adding recovery, for
Kaelyn Uhrain [Wed, 31 Jul 2013 17:38:24 +0000 (17:38 +0000)]
Improve the diagnostic experience, including adding recovery, for
changing '->' to '.' when there is no operator-> defined for a class.

llvm-svn: 187504

11 years agoObjectiveC arc: Move check for type conversions in arc
Fariborz Jahanian [Wed, 31 Jul 2013 17:12:26 +0000 (17:12 +0000)]
ObjectiveC arc: Move check for type conversions in arc
out of ImpCastExprToType and to the caller site
as appropriate. This is in prep. to do more work for
// rdar://14569171

llvm-svn: 187503

11 years agoFix a comment.
Hans Wennborg [Wed, 31 Jul 2013 16:57:56 +0000 (16:57 +0000)]
Fix a comment.

llvm-svn: 187502

11 years agoUpdate break conditions test to have consistent behaviour on all test suite compilers.
Matt Kopec [Wed, 31 Jul 2013 16:27:27 +0000 (16:27 +0000)]
Update break conditions test to have consistent behaviour on all test suite compilers.
Also update comment in const variables test to reflect ICC status.

llvm-svn: 187501

11 years agoSet an extra debug flag when testing with ICC so that it generates the correct debug...
Matt Kopec [Wed, 31 Jul 2013 16:10:03 +0000 (16:10 +0000)]
Set an extra debug flag when testing with ICC so that it generates the correct debug info for inlined tests.

llvm-svn: 187500

11 years agoUpdated the LLDB rvalue reference test to cross-reference with a bugzilla report,
Ashok Thirumurthi [Wed, 31 Jul 2013 15:58:01 +0000 (15:58 +0000)]
Updated the LLDB rvalue reference test to cross-reference with a bugzilla report,
provide more detail on compiler compatibility, and to illustrate that this is
an issue with expression evaluation.

- Note that clang doesn't emit DW_TAG_const_type, which might be okay if there's
no such thing as a non-const rvalue reference.  How about foo(make_int())?

llvm-svn: 187499

11 years agoDependence: Add DEBUG support.
Tobias Grosser [Wed, 31 Jul 2013 14:35:17 +0000 (14:35 +0000)]
Dependence: Add DEBUG support.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 187498

11 years ago[SystemZ] Implement isLegalAddressingMode()
Richard Sandiford [Wed, 31 Jul 2013 12:58:26 +0000 (12:58 +0000)]
[SystemZ] Implement isLegalAddressingMode()

The loop optimizers were assuming that scales > 1 were OK.  I think this
is actually a bug in TargetLoweringBase::isLegalAddressingMode(),
since it seems to be trying to reject anything that isn't r+i or r+r,
but it has no default case for scales other than 0, 1 or 2.  Implementing
the hook for z means that z can no longer test any change there though.

llvm-svn: 187497

11 years ago[SystemZ] Be more careful about inverting CC masks (conditional loads)
Richard Sandiford [Wed, 31 Jul 2013 12:38:08 +0000 (12:38 +0000)]
[SystemZ] Be more careful about inverting CC masks (conditional loads)

Extend r187495 to conditional loads.  I split this out because the
easiest way seemed to be to force a particular operand order in
SystemZISelDAGToDAG.cpp.

llvm-svn: 187496

11 years ago[SystemZ] Be more careful about inverting CC masks
Richard Sandiford [Wed, 31 Jul 2013 12:30:20 +0000 (12:30 +0000)]
[SystemZ] Be more careful about inverting CC masks

System z branches have a mask to select which of the 4 CC values should
cause the branch to be taken.  We can invert a branch by inverting the mask.
However, not all instructions can produce all 4 CC values, so inverting
the branch like this can lead to some oddities.  For example, integer
comparisons only produce a CC of 0 (equal), 1 (less) or 2 (greater).
If an integer EQ is reversed to NE before instruction selection,
the branch will test for 1 or 2.  If instead the branch is reversed
after instruction selection (by inverting the mask), it will test for
1, 2 or 3.  Both are correct, but the second isn't really canonical.
This patch therefore keeps track of which CC values are possible
and uses this when inverting a mask.

Although this is mostly cosmestic, it fixes undefined behavior
for the CIJNLH in branch-08.ll.  Another fix would have been
to mask out bit 0 when generating the fused compare and branch,
but the point of this patch is that we shouldn't need to do that
in the first place.

The patch also makes it easier to reuse CC results from other instructions.

llvm-svn: 187495

11 years ago[SystemZ] Move compare-and-branch generation even later
Richard Sandiford [Wed, 31 Jul 2013 12:11:07 +0000 (12:11 +0000)]
[SystemZ] Move compare-and-branch generation even later

r187116 moved compare-and-branch generation from the instruction-selection
pass to the peephole optimizer (via optimizeCompare).  It turns out that even
this is a bit too early.  Fused compare-and-branch instructions don't
interact well with predication, where a CC result is needed.  They also
make it harder to reuse the CC side-effects of earlier instructions
(not yet implemented, but the subject of a later patch).

Another problem was that the AnalyzeBranch family of routines weren't
handling compares and branches, so we weren't able to reverse the fused
form in cases where we would reverse a separate branch.  This could have
been fixed by extending AnalyzeBranch, but given the other problems,
I've instead moved the fusing to the long-branch pass, which is also
responsible for the opposite transformation: splitting out-of-range
compares and branches into separate compares and long branches.

I've added a test for the AnalyzeBranch problem.  A test for the
predication problem is included in the next patch, which fixes a bug
in the choice of CC mask.

llvm-svn: 187494

11 years agoFixed assertion in Extract128BitVector()
Elena Demikhovsky [Wed, 31 Jul 2013 12:03:08 +0000 (12:03 +0000)]
Fixed assertion in Extract128BitVector()

llvm-svn: 187493

11 years ago[SystemZ] Postpone NI->RISBG conversion to convertToThreeAddress()
Richard Sandiford [Wed, 31 Jul 2013 11:36:35 +0000 (11:36 +0000)]
[SystemZ] Postpone NI->RISBG conversion to convertToThreeAddress()

r186399 aggressively used the RISBG instruction for immediate ANDs,
both because it can handle some values that AND IMMEDIATE can't,
and because it allows the destination register to be different from
the source.  I realized later while implementing the distinct-ops
support that it would be better to leave the choice up to
convertToThreeAddress() instead.  The AND IMMEDIATE form is shorter
and is less likely to be cracked.

This is a problem for 32-bit ANDs because we assume that all 32-bit
operations will leave the high word untouched, whereas RISBG used in
this way will either clear the high word or copy it from the source
register.  The patch uses the z196 instruction RISBLG for this instead.

This means that z10 will be restricted to NILL, NILH and NILF for
32-bit ANDs, but I think that should be OK for now.  Although we're
using z10 as the base architecture, the optimization work is going
to be focused more on z196 and zEC12.

llvm-svn: 187492

11 years agoAdded INSERT and EXTRACT intructions from AVX-512 ISA.
Elena Demikhovsky [Wed, 31 Jul 2013 11:35:14 +0000 (11:35 +0000)]
Added INSERT and EXTRACT intructions from AVX-512 ISA.
All insertf*/extractf* functions replaced with insert/extract since we have insertf and inserti forms.
Added lowering for INSERT_VECTOR_ELT / EXTRACT_VECTOR_ELT for 512-bit vectors.
Added lowering for EXTRACT/INSERT subvector for 512-bit vectors.
Added a test.

llvm-svn: 187491