platform/upstream/llvm.git
9 years agoChange order of tablegen generated fast-isel instruction code to be
Bill Schmidt [Fri, 14 Nov 2014 21:05:45 +0000 (21:05 +0000)]
Change order of tablegen generated fast-isel instruction code to be
based on instruction complexity

The order that tablegen fast-isel instruction code is generated is
currently based on the text of the predicate (using string
less-than). This patch changes this to instead use the instruction
complexity. Because the complexities are not unique a C++ multimap is
used instead of a map.

This fixes the problem where code with no predicate always comes out
first (the empty string always compares as less than all other
strings) thus making the code with predicates dead code. See the FMUL
code in PPCFastISel.cpp for an example. It also more closely matches
the normal codegen ordering. Some error checking in the tablegen
fast-isel code is fixed as well.

Patch by Bill Seurer.

llvm-svn: 222038

9 years agoR600/SI: Mark s_movk_i32 as rematerializable
Tom Stellard [Fri, 14 Nov 2014 20:43:28 +0000 (20:43 +0000)]
R600/SI: Mark s_movk_i32 as rematerializable

llvm-svn: 222037

9 years agoR600/SI: Fix spilling of m0 register
Tom Stellard [Fri, 14 Nov 2014 20:43:26 +0000 (20:43 +0000)]
R600/SI: Fix spilling of m0 register

If we have spilled the value of the m0 register, then we need to restore
it with v_readlane_b32 to a regular sgpr, because v_readlane_b32 can't
write to m0.

v_readlane_b32 can't write to m0, so

llvm-svn: 222036

9 years agoAdd -gline-tables-only when compiling w/ sanitizers in RELEASE
Eric Fiselier [Fri, 14 Nov 2014 20:38:07 +0000 (20:38 +0000)]
Add -gline-tables-only when compiling w/ sanitizers in RELEASE

llvm-svn: 222035

9 years agoCOFF: Add support for Dwarf accelerator tables.
Frederic Riss [Fri, 14 Nov 2014 20:33:40 +0000 (20:33 +0000)]
COFF: Add support for Dwarf accelerator tables.

This allows COFF targets to emit accelerator tables
when requested by -dwarf-accel-tables=Enable instead
of aborting. The test DebugInfo/cross-cu-inlining.ll
covers this on COFF platforms.

llvm-svn: 222034

9 years agoMinGW doesn't implement std::to_string; working around it. NFC.
Aaron Ballman [Fri, 14 Nov 2014 20:31:50 +0000 (20:31 +0000)]
MinGW doesn't implement std::to_string; working around it. NFC.

llvm-svn: 222033

9 years agoR600/SI: Combine min3/max3 instructions
Matt Arsenault [Fri, 14 Nov 2014 20:08:52 +0000 (20:08 +0000)]
R600/SI: Combine min3/max3 instructions

llvm-svn: 222032

9 years agoadd Makefile rule for test program CREATE_STD_THREADS
Shawn Best [Fri, 14 Nov 2014 19:41:33 +0000 (19:41 +0000)]
add Makefile rule for test program CREATE_STD_THREADS

Effectively removes -lpthreads from linux/gcc build of test programs in test/api/multithreaded. This was done due to that combination causing a test program to hang due, likely due to an issue with gcc linker and libstdc++ conflicting pthreads code in test program and pthread used by lldb.  Issue has been documented at:
http://llvm.org/bugs/show_bug.cgi?id=21553

Differential Revision: http://reviews.llvm.org/D5838

llvm-svn: 222031

9 years agoyaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeaders
David Majnemer [Fri, 14 Nov 2014 19:35:59 +0000 (19:35 +0000)]
yaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeaders

SizeOfHeaders must be aligned to the FileAlignment.
SizeOfImage must be at least the SizeOfHeaders aligned to the
SectionAlignment.

llvm-svn: 222030

9 years ago[dwarfdump] Handle relocations in Dwarf accelerator tables
Frederic Riss [Fri, 14 Nov 2014 19:30:08 +0000 (19:30 +0000)]
[dwarfdump] Handle relocations in Dwarf accelerator tables

ELF targets (and maybe COFF) use relocations when referring
to strings in the .debug_str section. Handle that in the
accelerator table dumper. This commit restores the
test/DebugInfo/cross-cu-inlining.ll test to its expected
platform independant form, validating that the fix works
(this test failed on linux boxes).

llvm-svn: 222029

9 years agoRemove some redundant virtual on overridden functions
David Blaikie [Fri, 14 Nov 2014 19:27:22 +0000 (19:27 +0000)]
Remove some redundant virtual on overridden functions

llvm-svn: 222027

9 years ago[PECOFF] Remove dead code
Rui Ueyama [Fri, 14 Nov 2014 19:21:06 +0000 (19:21 +0000)]
[PECOFF] Remove dead code

AddressOfEntryPoint is overridden after we layout all atoms (until then,
we don't know the entry point address for obvious reason.)
I believe this code is leftover from very early version of the
PE/COFF port that we only had an entry function in a test object file.

llvm-svn: 222026

9 years ago[libcxx] Fix memory leak in strstream tests.
Eric Fiselier [Fri, 14 Nov 2014 19:10:43 +0000 (19:10 +0000)]
[libcxx] Fix memory leak in strstream tests.

Summary: The strstream function `str()` sets `freeze(true)`. When `freeze` is true the destructor is not allowed to free any dynamically allocated memory. The memory leak causes ASAN to fail on these tests. To ensure memory is deallocated `strstream.freeze(false)` is called at the end of the tests.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6261

llvm-svn: 222025

9 years agoRemove some redundant virtual specifiers on overriden functions.
David Blaikie [Fri, 14 Nov 2014 19:09:44 +0000 (19:09 +0000)]
Remove some redundant virtual specifiers on overriden functions.

llvm-svn: 222024

9 years agoRemove redundant virtual on overriden functions.
David Blaikie [Fri, 14 Nov 2014 19:06:36 +0000 (19:06 +0000)]
Remove redundant virtual on overriden functions.

llvm-svn: 222023

9 years agoIR: Make MDString inherit from Metadata
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:45:40 +0000 (18:45 +0000)]
IR: Make MDString inherit from Metadata

llvm-svn: 222022

9 years agoSilence inconsistent override warnings.
Eric Christopher [Fri, 14 Nov 2014 18:44:53 +0000 (18:44 +0000)]
Silence inconsistent override warnings.

llvm-svn: 222021

9 years agoR600/SI: Fix verifier error from a branch on IMPLICIT_DEF
Matt Arsenault [Fri, 14 Nov 2014 18:43:41 +0000 (18:43 +0000)]
R600/SI: Fix verifier error from a branch on IMPLICIT_DEF

SIILowerI1Copies wasn't correctly handling this case.

llvm-svn: 222020

9 years agoIR: Take an LLVMContext in Metadata::Metadata()
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:09 +0000 (18:42 +0000)]
IR: Take an LLVMContext in Metadata::Metadata()

llvm-svn: 222019

9 years agoAdd a blank line, NFC
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:06 +0000 (18:42 +0000)]
Add a blank line, NFC

llvm-svn: 222018

9 years agoFix unused variable warning without asserts
Matt Arsenault [Fri, 14 Nov 2014 18:40:49 +0000 (18:40 +0000)]
Fix unused variable warning without asserts

llvm-svn: 222017

9 years agoTypo fix.
Yaron Keren [Fri, 14 Nov 2014 18:33:42 +0000 (18:33 +0000)]
Typo fix.

llvm-svn: 222016

9 years agoR600/SI: Match integer min / max instructions
Matt Arsenault [Fri, 14 Nov 2014 18:30:06 +0000 (18:30 +0000)]
R600/SI: Match integer min / max instructions

llvm-svn: 222015

9 years ago[libcxx] Fix vector annotator size increase in `vector::insert(pos, count, value)`
Eric Fiselier [Fri, 14 Nov 2014 18:28:36 +0000 (18:28 +0000)]
[libcxx] Fix vector annotator size increase in `vector::insert(pos, count, value)`

Summary:
The size of the vector is being increased by `__n` during the call to `__move_range` and not by 1.
This fixes a test failure in `containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp` when using ASAN.

Reviewers: danalbert, kcc, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6264

llvm-svn: 222014

9 years agoclang-cl: Ignore the new /Zo[-] option (PR21571)
Hans Wennborg [Fri, 14 Nov 2014 18:24:08 +0000 (18:24 +0000)]
clang-cl: Ignore the new /Zo[-] option (PR21571)

Also fix the ignored options test which didn't fail properly on
unknown options.

llvm-svn: 222013

9 years agoR600/SI: Use S_BFE_I64 for 64-bit sext_inreg
Matt Arsenault [Fri, 14 Nov 2014 18:18:16 +0000 (18:18 +0000)]
R600/SI: Use S_BFE_I64 for 64-bit sext_inreg

llvm-svn: 222012

9 years agoclang-format: [Java] Further improve generics formatting.
Daniel Jasper [Fri, 14 Nov 2014 17:30:15 +0000 (17:30 +0000)]
clang-format: [Java] Further improve generics formatting.

llvm-svn: 222011

9 years agoclang-format: Correctly detect multiplication in ctor initializer.
Daniel Jasper [Fri, 14 Nov 2014 17:26:49 +0000 (17:26 +0000)]
clang-format: Correctly detect multiplication in ctor initializer.

Before:
  Constructor() : a(a), area(width *height) {}

After:
  Constructor() : a(a), area(width * height) {}

llvm-svn: 222010

9 years ago[Sema]. Warn when logical expression is a pointer
Fariborz Jahanian [Fri, 14 Nov 2014 17:12:50 +0000 (17:12 +0000)]
[Sema]. Warn when logical expression is a pointer
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu

llvm-svn: 222009

9 years ago[Reassociate] Canonicalize the operands of all binary operators.
Chad Rosier [Fri, 14 Nov 2014 17:09:19 +0000 (17:09 +0000)]
[Reassociate] Canonicalize the operands of all binary operators.

llvm-svn: 222008

9 years agoTentatively appease the bots.
Frederic Riss [Fri, 14 Nov 2014 17:08:18 +0000 (17:08 +0000)]
Tentatively appease the bots.

If this workaround gets the bots green, then we have to find out
why the -dwarf-accel-tables=Enable option doesn't work as
expected on non-darwin platforms.

llvm-svn: 222007

9 years ago[Reassociate] Canonicalize operands of vector binary operators.
Chad Rosier [Fri, 14 Nov 2014 17:08:15 +0000 (17:08 +0000)]
[Reassociate] Canonicalize operands of vector binary operators.

Prior to this commit fmul and fadd binary operators were being canonicalized for
both scalar and vector versions.  We now canonicalize add, mul, and, or, and xor
vector instructions.

llvm-svn: 222006

9 years ago[Reassociate] Canonicalize constants to RHS operand.
Chad Rosier [Fri, 14 Nov 2014 17:05:59 +0000 (17:05 +0000)]
[Reassociate] Canonicalize constants to RHS operand.

llvm-svn: 222005

9 years agoApply SOCK_CLOEXEC flag to socket API functions in order to avoid handle leakage...
Oleksiy Vyalov [Fri, 14 Nov 2014 16:25:18 +0000 (16:25 +0000)]
Apply SOCK_CLOEXEC flag to socket API functions in order to avoid handle leakage to a forked child process.

http://reviews.llvm.org/D6204

llvm-svn: 222004

9 years agoReapply "[dwarfdump] Add support for dumping accelerator tables."
Frederic Riss [Fri, 14 Nov 2014 16:15:53 +0000 (16:15 +0000)]
Reapply "[dwarfdump] Add support for dumping accelerator tables."

This reverts commit r221842 which was a revert of r221836 and of the
test parts of r221837.

This new version fixes an UB bug pointed out by David (along with
addressing some other review comments), makes some dumping more
resilient to broken input data and forces the accelerator tables
to be dumped in the tests where we use them (this decision is
platform specific otherwise).

llvm-svn: 222003

9 years ago[AVX512] Add 512b masked integer shift by immediate patterns.
Cameron McInally [Fri, 14 Nov 2014 15:43:00 +0000 (15:43 +0000)]
[AVX512] Add 512b masked integer shift by immediate patterns.

llvm-svn: 222002

9 years ago[ASan] Improved stack overflow detection for PowerPC64
Jay Foad [Fri, 14 Nov 2014 15:30:39 +0000 (15:30 +0000)]
[ASan] Improved stack overflow detection for PowerPC64

Summary:
AsanOnSIGSEGV has some heuristics for detecting stack overflow, but
they don't cope with a PowerPC store-with-update instruction which
modifies sp and stores to the modified address in one instruction.

This patch adds some PowerPC-specific code to check for this case.

This fixes the last few cases of the stack-overflow test.

Reviewers: kcc, samsonov, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6253

llvm-svn: 222001

9 years ago[sanitizer] Extend a comment in SlowUnwind.
Evgeniy Stepanov [Fri, 14 Nov 2014 15:13:23 +0000 (15:13 +0000)]
[sanitizer] Extend a comment in SlowUnwind.

This better explains a change in r221520.

llvm-svn: 222000

9 years ago[Reassociate] Improve rank debug information. NFC.
Chad Rosier [Fri, 14 Nov 2014 15:01:38 +0000 (15:01 +0000)]
[Reassociate] Improve rank debug information. NFC.

llvm-svn: 221999

9 years agoSilencing a -Wparentheses warning; NFC.
Aaron Ballman [Fri, 14 Nov 2014 14:40:49 +0000 (14:40 +0000)]
Silencing a -Wparentheses warning; NFC.

llvm-svn: 221998

9 years agoReplace weird whitespace symbols with good old spaces
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:16:34 +0000 (14:16 +0000)]
Replace weird whitespace symbols with good old spaces

llvm-svn: 221997

9 years agoAdd one illustrative class hierarchy as an example in a comment to the VFTableBuilder...
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:10:15 +0000 (14:10 +0000)]
Add one illustrative class hierarchy as an example in a comment to the VFTableBuilder code

llvm-svn: 221996

9 years agoR600/SI: Fix assembly names for exec_hi and exec_lo
Tom Stellard [Fri, 14 Nov 2014 14:08:04 +0000 (14:08 +0000)]
R600/SI: Fix assembly names for exec_hi and exec_lo

llvm-svn: 221995

9 years agoR600/SI: Start implementing an assembler
Tom Stellard [Fri, 14 Nov 2014 14:08:00 +0000 (14:08 +0000)]
R600/SI: Start implementing an assembler

This was done using the Sparc and PowerPC AsmParsers as guides.  So far it
is very simple and only supports sopp instructions.

llvm-svn: 221994

9 years agoOops, the underline was too short for sphinx to like.
Aaron Ballman [Fri, 14 Nov 2014 14:01:55 +0000 (14:01 +0000)]
Oops, the underline was too short for sphinx to like.

llvm-svn: 221993

9 years agoCorrecting some grammar and typos, and adding CERT as a collaborator.
Aaron Ballman [Fri, 14 Nov 2014 13:48:34 +0000 (13:48 +0000)]
Correcting some grammar and typos, and adding CERT as a collaborator.

llvm-svn: 221992

9 years agoComplete support for the SD-6 standing document (based off N4200) with support for...
Aaron Ballman [Fri, 14 Nov 2014 13:44:02 +0000 (13:44 +0000)]
Complete support for the SD-6 standing document (based off N4200) with support for __has_cpp_attribute.

llvm-svn: 221991

9 years agoclang-format: Give clang-format-diff.py a -v option.
Daniel Jasper [Fri, 14 Nov 2014 13:27:28 +0000 (13:27 +0000)]
clang-format: Give clang-format-diff.py a -v option.

With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.

llvm-svn: 221990

9 years agoclang-format: Improve function parameter packing.
Daniel Jasper [Fri, 14 Nov 2014 13:14:45 +0000 (13:14 +0000)]
clang-format: Improve function parameter packing.

Before:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa, int bbbbbbbbbbbbb);

After:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa,
      int bbbbbbbbbbbbb);

llvm-svn: 221989

9 years ago[PowerPC] Enable vec_perm for long long and double vector types for VSX
Bill Schmidt [Fri, 14 Nov 2014 13:10:13 +0000 (13:10 +0000)]
[PowerPC] Enable vec_perm for long long and double vector types for VSX

VSX makes the "vector long long" and "vector double" types available.
This patch enables the vec_perm interface for these types.  The same
builtin is generated regardless of the specified type, so no
additional work or testing is needed in the back end.  Tests are added
to ensure this builtin is generated by the front end.

llvm-svn: 221988

9 years agoclang-format: Support assignments as conditional operands.
Daniel Jasper [Fri, 14 Nov 2014 13:03:40 +0000 (13:03 +0000)]
clang-format: Support assignments as conditional operands.

Before:
  return a != b
             // comment
             ? a
             : a = a != b
                   // comment
         ? a =
               b : a;
After:
  return a != b
             // comment
             ? a
             : a = a != b
                       // comment
                       ? a = b
                       : a;

llvm-svn: 221987

9 years ago[asan] Revert r221882.
Evgeniy Stepanov [Fri, 14 Nov 2014 13:02:28 +0000 (13:02 +0000)]
[asan] Revert r221882.

This code is not part of ASan runtime (as it may be linked into a different
DSO), and thus can not call non-exported functions.

llvm-svn: 221986

9 years agoclang-format: Improve indentation of comments in expressions.
Daniel Jasper [Fri, 14 Nov 2014 12:31:14 +0000 (12:31 +0000)]
clang-format: Improve indentation of comments in expressions.

Before:
  int i = (a)
              // comment
          + b;
  return aaaa == bbbb
                 // comment
             ? aaaa
             : bbbb;
After:
  int i = (a)
          // comment
          + b;
  return aaaa == bbbb
             // comment
             ? aaaa
             : bbbb;

llvm-svn: 221985

9 years ago[PowerPC] Add VSX builtins for vec_div
Bill Schmidt [Fri, 14 Nov 2014 12:10:51 +0000 (12:10 +0000)]
[PowerPC] Add VSX builtins for vec_div

This patch adds builtin support for xvdivdp and xvdivsp, along with a
new test case.  The builtins are accessed using vec_div in altivec.h.
Builtins are listed (mostly) alphabetically there, so inserting these
changed the line numbers for deprecation warnings tested in
test/Headers/altivec-intrin.c.

There is a companion patch for LLVM.

llvm-svn: 221984

9 years ago[PowerPC] Add VSX builtins for vec_div
Bill Schmidt [Fri, 14 Nov 2014 12:10:40 +0000 (12:10 +0000)]
[PowerPC] Add VSX builtins for vec_div

This patch adds builtin support for xvdivdp and xvdivsp, along with a
test case.  Straightforward stuff.

There's a companion patch for Clang.

llvm-svn: 221983

9 years agoUse nullptr instead of '0' for pointers
Tobias Grosser [Fri, 14 Nov 2014 11:12:31 +0000 (11:12 +0000)]
Use nullptr instead of '0' for pointers

llvm-svn: 221982

9 years agoclang-format: [Java] Fix line break behavior of class declarations.
Daniel Jasper [Fri, 14 Nov 2014 10:15:56 +0000 (10:15 +0000)]
clang-format: [Java] Fix line break behavior of class declarations.

Change breaking preferences:
1. Break before "extends"
2. Break before "implements"
3. Break within the implements list.

llvm-svn: 221981

9 years agoProperly specify the regex used to match register indexes.
Stephane Sezer [Fri, 14 Nov 2014 09:46:21 +0000 (09:46 +0000)]
Properly specify the regex used to match register indexes.

Summary: Something like "core:1" would match and try to be interpreted by the following code otherwise.

Test Plan: Run tests and make sure the ones failing previously now pass.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D6257

llvm-svn: 221980

9 years agoclang-format: [Java] Improve generic return type formatting.
Daniel Jasper [Fri, 14 Nov 2014 09:05:32 +0000 (09:05 +0000)]
clang-format: [Java] Improve generic return type formatting.

Before:
  public<R> ArrayList<R> get() {

After:
  public <R> ArrayList<R> get() {

llvm-svn: 221979

9 years agoclang-format: [Java] No altnerative operator names in Java.
Daniel Jasper [Fri, 14 Nov 2014 09:02:28 +0000 (09:02 +0000)]
clang-format: [Java] No altnerative operator names in Java.

Before:
  someObject.and ();

After:
  someObject.and();

llvm-svn: 221978

9 years agoCalm down build bots
David Majnemer [Fri, 14 Nov 2014 08:38:17 +0000 (08:38 +0000)]
Calm down build bots

r221975 seemed to trigger an ambiguous conversion that only irritated
clang, not gcc.

llvm-svn: 221977

9 years agoclang-format: [Java] Improve formatting of generics.
Daniel Jasper [Fri, 14 Nov 2014 08:22:46 +0000 (08:22 +0000)]
clang-format: [Java] Improve formatting of generics.

Before:
  Function < F, ? extends T > function;

After:
  Function<F, ? extends T> function;

llvm-svn: 221976

9 years agoobj2yaml, yaml2obj: Add support for COFF executables
David Majnemer [Fri, 14 Nov 2014 08:15:42 +0000 (08:15 +0000)]
obj2yaml, yaml2obj: Add support for COFF executables

In support of serializing executables, obj2yaml now records the virtual address
and size of sections.  It also serializes whatever we strictly need from
the PE header, it expects that it can reconstitute everything else via
inference.

yaml2obj can reconstitute a fully linked executable.

In order to get executables correctly serialized/deserialized, other
bugs were fixed as a circumstance.  We now properly respect file and
section alignments.  We also avoid writing out string tables unless they
are strictly necessary.

llvm-svn: 221975

9 years agoFollow-up to r221913. Fix some -Wcast-qual warning reasons.
Simon Atanasyan [Fri, 14 Nov 2014 07:15:43 +0000 (07:15 +0000)]
Follow-up to r221913. Fix some -Wcast-qual warning reasons.

llvm-svn: 221974

9 years agoUse size_type for operator[].
Rafael Espindola [Fri, 14 Nov 2014 07:02:38 +0000 (07:02 +0000)]
Use size_type for operator[].

This matches std::vector and is more efficient as it avoids
truncations.

With this the text segment of opt goes from 19705442 bytes
to 19703930 bytes.

llvm-svn: 221973

9 years ago[ELF] Dynamic section was not aligned properly.
Shankar Easwaran [Fri, 14 Nov 2014 04:57:21 +0000 (04:57 +0000)]
[ELF] Dynamic section was not aligned properly.

The dynamic section was not aligned properly. The alignment of the section is
determined by the word size of the architecture.

llvm-svn: 221972

9 years agoSearchForAddressOfSymbol(): Disable 3 symbols, copysignf, fminf, and fmaxf, on msc17...
NAKAMURA Takumi [Fri, 14 Nov 2014 04:53:55 +0000 (04:53 +0000)]
SearchForAddressOfSymbol(): Disable 3 symbols, copysignf, fminf, and fmaxf, on msc17. *These were added in VS 2013*

llvm-svn: 221971

9 years ago[OPENMP] Temporary fix for processing of global variables in loops.
Alexey Bataev [Fri, 14 Nov 2014 04:08:45 +0000 (04:08 +0000)]
[OPENMP] Temporary fix for processing of global variables in loops.
Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted.

llvm-svn: 221970

9 years agoSplit string capacity test into two parts and mark one part as UNSUPPORTED when using...
Eric Fiselier [Fri, 14 Nov 2014 03:16:12 +0000 (03:16 +0000)]
Split string capacity test into two parts and mark one part as UNSUPPORTED when using sanitizers.

The test is split such that:
- max_size.pass.cpp tests that string::resize() fails to allocator for max_size
  and max_size -1
- over_max_size.pass.cpp tests that string::resize() throws a length error for
  max_size + 1

The test was split into two because max_size.pass.cpp cannot pass with
sanitizers but over_max_size.pass.cpp can.

llvm-svn: 221969

9 years ago[Sanitizer] Refactor SanitizerArgs parsing in Driver.
Alexey Samsonov [Fri, 14 Nov 2014 02:59:20 +0000 (02:59 +0000)]
[Sanitizer] Refactor SanitizerArgs parsing in Driver.

Remove flag parsing details from the public header.
Use SanitizerSet to represent the set of enabled sanitizers.
Cleanup the implementation: update the comments to
reflect reality, remove dead code.

No functionality change.

llvm-svn: 221968

9 years agoMark more tests as UNSUPPORTED with ASAN and MSAN.
Eric Fiselier [Fri, 14 Nov 2014 02:55:16 +0000 (02:55 +0000)]
Mark more tests as UNSUPPORTED with ASAN and MSAN.

These tests fail for 2 reasons when using ASAN and MSAN.
1. If allocator_may_return_null=0 they will fail because null is returned
   or an exception is thrown.
2. When allocator_may_return_null=1 the new_handler is still not called. This
   results in an assertion failures.

llvm-svn: 221967

9 years agoSetup llvm-symbolizer when running the tests with sanitizers
Eric Fiselier [Fri, 14 Nov 2014 02:47:08 +0000 (02:47 +0000)]
Setup llvm-symbolizer when running the tests with sanitizers

llvm-svn: 221966

9 years agoR600/SI: Make constant array static
Matt Arsenault [Fri, 14 Nov 2014 02:21:58 +0000 (02:21 +0000)]
R600/SI: Make constant array static

llvm-svn: 221965

9 years agoAdd -O3 when testing with UBSAN. This triggers far undefined behaviour
Eric Fiselier [Fri, 14 Nov 2014 02:07:52 +0000 (02:07 +0000)]
Add -O3 when testing with UBSAN. This triggers far undefined behaviour

llvm-svn: 221964

9 years agoRemove -fseh-exceptions in favor of checking the triple
Reid Kleckner [Fri, 14 Nov 2014 02:01:10 +0000 (02:01 +0000)]
Remove -fseh-exceptions in favor of checking the triple

This option was misleading because it looked like it enabled the
language feature of SEH (__try / __except), when this option was really
controlling which EH personality function to use. Mingw only supports
SEH and SjLj EH on x86_64, so we can simply do away with this flag.

llvm-svn: 221963

9 years agollvm-cov: Sink some reporting logic into CoverageMapping
Justin Bogner [Fri, 14 Nov 2014 01:50:32 +0000 (01:50 +0000)]
llvm-cov: Sink some reporting logic into CoverageMapping

This teaches CoverageMapping::getCoveredFunctions to filter to a
particular file and uses that to replace most of the logic found in
llvm-cov report.

llvm-svn: 221962

9 years agoX86: use getConstant rather than getTargetConstant behind BUILD_VECTOR.
Tim Northover [Fri, 14 Nov 2014 01:30:14 +0000 (01:30 +0000)]
X86: use getConstant rather than getTargetConstant behind BUILD_VECTOR.

getTargetConstant should only be used when you can guarantee the instruction
selected will be able to cope with the raw value. BUILD_VECTOR is rather too
generic for this so we should use getConstant instead. In that case, an
instruction can still consume the constant, but if it doesn't it'll be
materialised through its own round of ISel.

Should fix PR21352.

llvm-svn: 221961

9 years agoIR: Rewrite uniquing and creation of MDString
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 01:17:09 +0000 (01:17 +0000)]
IR: Rewrite uniquing and creation of MDString

Stop using `Value::getName()` to get the string behind an `MDString`.
Switch to `StringMapEntry<MDString>` so that we can find the string by
its coallocation.

This is part of PR21532.

llvm-svn: 221960

9 years agoCleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.
Alexey Samsonov [Fri, 14 Nov 2014 00:46:39 +0000 (00:46 +0000)]
Cleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.

llvm-svn: 221959

9 years agoStringMap: Test and finish off supporting perfectly forwarded values in StringMap...
David Blaikie [Fri, 14 Nov 2014 00:41:46 +0000 (00:41 +0000)]
StringMap: Test and finish off supporting perfectly forwarded values in StringMap operations.

Followup to r221946.

llvm-svn: 221958

9 years agoFix 80 cols caught by the linter...
David Blaikie [Fri, 14 Nov 2014 00:41:42 +0000 (00:41 +0000)]
Fix 80 cols caught by the linter...

We have a linter running in our build now?

llvm-svn: 221957

9 years agoFix build of Mips code with MSVC by using our macro instead of __attribute__((unused...
Reid Kleckner [Fri, 14 Nov 2014 00:39:33 +0000 (00:39 +0000)]
Fix build of Mips code with MSVC by using our macro instead of __attribute__((unused)) directly

llvm-svn: 221956

9 years agoPR21565 Add an egregious hack to support broken libstdc++ headers that declare
Richard Smith [Fri, 14 Nov 2014 00:37:55 +0000 (00:37 +0000)]
PR21565 Add an egregious hack to support broken libstdc++ headers that declare
a member named 'swap' and then expect unqualified lookup for the name 'swap' in
its exception specification to find anything else.

Without delay-parsed exception specifications, this was ill-formed (NDR) by
[basic.scope.class]p1, rule 2. With delay-parsed exception specifications, the
call to 'swap' unambiguously finds the function being declared, which then
fails because the arguments don't work for that function.

llvm-svn: 221955

9 years agoAllow the use of functions as typeinfo in landingpad clauses
Reid Kleckner [Fri, 14 Nov 2014 00:35:50 +0000 (00:35 +0000)]
Allow the use of functions as typeinfo in landingpad clauses

This is one step towards supporting SEH filter functions in LLVM.

llvm-svn: 221954

9 years agoCodeGen: assert an instruction is being inserted with the correct iterator.
Tim Northover [Fri, 14 Nov 2014 00:34:59 +0000 (00:34 +0000)]
CodeGen: assert an instruction is being inserted with the correct iterator.

When "MBB->Insert(It, ...)" is called, we want It to be pointing inside the
correct basic block. No actual failures at the moment, but it's caused problems
before.

llvm-svn: 221953

9 years ago[Profile] Always build profile runtime library with -fPIC.
Alexey Samsonov [Fri, 14 Nov 2014 00:16:26 +0000 (00:16 +0000)]
[Profile] Always build profile runtime library with -fPIC.

This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.

llvm-svn: 221952

9 years agoIR: Make MDString::getName() private
Duncan P. N. Exon Smith [Thu, 13 Nov 2014 23:59:16 +0000 (23:59 +0000)]
IR: Make MDString::getName() private

Hide the fact that `MDString`'s string is stored in `Value::Name` --
that's going to change soon.  Update the only in-tree client that was
using it instead of `Value::getString()`.

Part of PR21532.

llvm-svn: 221951

9 years agofix minor comment typo
Vince Harron [Thu, 13 Nov 2014 23:45:59 +0000 (23:45 +0000)]
fix minor comment typo

llvm-svn: 221950

9 years agoFix the VS 2012 build
Reid Kleckner [Thu, 13 Nov 2014 23:45:50 +0000 (23:45 +0000)]
Fix the VS 2012 build

VS 2012 doesn't have fminf or fmaxf.

llvm-svn: 221949

9 years agoFirst stage of call lowering for Mips fast-isel
Reed Kotler [Thu, 13 Nov 2014 23:37:45 +0000 (23:37 +0000)]
First stage of call lowering for Mips fast-isel

Summary:
This has most of what is needed for mips fast-isel call lowering for O32.
What is missing I will add on the next patch because this patch is already too large.
It should not be doing anything wrong but it will punt on some cases that it is basically
capable of doing.

The mechanism is there for parameters to be passed on the stack but I have not enabled it because it serves as a way for now to prevent some of the strange cases of O32 register passing that I have not fully checked yet and have some issues.

The Mips O32 abi rules are very complicated as far how data is passed in floating and integer registers.

However there is a way to think about this all very simply and this implementation reflects that.

Basically, the ABI rules are written as if everything is passed on the stack and aligned as such.
Once that is conceptually done, it is nearly trivial to reassign those locations to registers and
then all the complexity disappears.

So I have told tablegen that all the data is passed on the stack and during the lowering I fix
this by assigning to registers as per the ABI doc.

This has been my approach and you can line up what I did with the ABI document and see 1 to 1 what
is going on.

Test Plan: callabi.ll

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: jholewinski, echristo, ahatanak, llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D5714

llvm-svn: 221948

9 years agoFix symbol resolution of floating point libc builtins in MCJIT
Reid Kleckner [Thu, 13 Nov 2014 23:32:52 +0000 (23:32 +0000)]
Fix symbol resolution of floating point libc builtins in MCJIT

Fix for LLI failure on Windows\X86: http://llvm.org/PR5053

LLI.exe crashes on Windows\X86 when single precession floating point
intrinsics like the following are used: acos, asin, atan, atan2, ceil,
copysign, cos, cosh, exp, floor, fmin, fmax, fmod, log, pow, sin, sinh,
sqrt, tan, tanh

The above intrinsics are defined as inline-expansions in math.h, and are
not exported by msvcr120.dll (Win32 API GetProcAddress returns null).

For an FREM instruction, the JIT compiler generates a call to a stub for
the fmodf() intrinsic, and adds a relocation to fixup at load time. The
loader searches the libraries for the function, but fails because the
symbol is not exported. So, the call target remains NULL and the
execution crashes.

Since the math functions are loaded at JIT/runtime, the JIT can patch
CALL instruction directly instead of the searching the libraries'
exported symbols.  However, this fix caused build failures due to
unresolved symbols like _fmodf at link time.

Therefore, the current fix defines helper functions in the Runtime
link/load library to perform the above operations.  The address of these
helper functions are used to patch up the CALL instruction at load time.

Reviewers: lhames, rnk

Reviewed By: rnk

Differential Revision: http://reviews.llvm.org/D5387

Patch by Swaroop Sridhar!

llvm-svn: 221947

9 years agoADT: Use perfect forwarding in StringMapEntry::Create()
Duncan P. N. Exon Smith [Thu, 13 Nov 2014 23:23:02 +0000 (23:23 +0000)]
ADT: Use perfect forwarding in StringMapEntry::Create()

Now you can pass references into constructors.

llvm-svn: 221946

9 years ago-Wsentinel: Suggest nullptr in C++11 instead of NULL
Reid Kleckner [Thu, 13 Nov 2014 23:19:36 +0000 (23:19 +0000)]
-Wsentinel: Suggest nullptr in C++11 instead of NULL

llvm-svn: 221945

9 years agoRelax the gcov version.ll test to check '.' instead of '\*'
Reid Kleckner [Thu, 13 Nov 2014 23:07:55 +0000 (23:07 +0000)]
Relax the gcov version.ll test to check '.' instead of '\*'

The escaping of the '\*' doesn't work with my combination of testing
tools.

llvm-svn: 221944

9 years agoSilence MSVC warning on missing return after fully covered switch
Reid Kleckner [Thu, 13 Nov 2014 23:07:22 +0000 (23:07 +0000)]
Silence MSVC warning on missing return after fully covered switch

llvm-svn: 221943

9 years agoFix assert/crash on invalid with __builtin_constant_p conditionals in constant expres...
Richard Smith [Thu, 13 Nov 2014 23:03:19 +0000 (23:03 +0000)]
Fix assert/crash on invalid with __builtin_constant_p conditionals in constant expressions.

llvm-svn: 221942

9 years agoR600/SI: Fix fmin_legacy / fmax_legacy matching for SI
Matt Arsenault [Thu, 13 Nov 2014 23:03:09 +0000 (23:03 +0000)]
R600/SI: Fix fmin_legacy / fmax_legacy matching for SI

select_cc is expanded on SI, so this was never matched.

llvm-svn: 221941

9 years agoUse nullptr instead of NULL for variadic sentinels
Reid Kleckner [Thu, 13 Nov 2014 22:55:19 +0000 (22:55 +0000)]
Use nullptr instead of NULL for variadic sentinels

Windows defines NULL to 0, which when used as an argument to a variadic
function, is not a null pointer constant. As a result, Clang's
-Wsentinel fires on this code. Using '0' would be wrong on most 64-bit
platforms, but both MSVC and Clang make it work on Windows. Sidestep the
issue with nullptr.

llvm-svn: 221940

9 years agoRevert "[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load...
Chad Rosier [Thu, 13 Nov 2014 22:54:59 +0000 (22:54 +0000)]
Revert "[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE."

This reverts commit r221924.  It appears the commit was a bit premature and is causing
bot failures that need further investigation.

llvm-svn: 221939

9 years ago[x86] Add some tests for specific patterns of lane-flips combined with
Chandler Carruth [Thu, 13 Nov 2014 22:49:44 +0000 (22:49 +0000)]
[x86] Add some tests for specific patterns of lane-flips combined with
in-lane shuffles that aren't always handled well by the current vector
shuffle lowering.

No functionality change yet, that will follow in a subsequent commit.

llvm-svn: 221938