platform/upstream/llvm.git
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

9 years agoMark more locale tests as unsupported with ASAN and MSAN
Eric Fiselier [Thu, 13 Nov 2014 22:45:23 +0000 (22:45 +0000)]
Mark more locale tests as unsupported with ASAN and MSAN

llvm-svn: 221937

9 years agoFix -Wcast-qual warnings in sanitizers
Alexey Samsonov [Thu, 13 Nov 2014 22:40:59 +0000 (22:40 +0000)]
Fix -Wcast-qual warnings in sanitizers

llvm-svn: 221936

9 years agoMove calls to push_back out of readAbbreviated(Literal|Field).
Rafael Espindola [Thu, 13 Nov 2014 22:29:02 +0000 (22:29 +0000)]
Move calls to push_back out of readAbbreviated(Literal|Field).

These functions always return a single value and not all callers want to
push them into a SmallVector.

llvm-svn: 221934

9 years agoObjective-C. Fixes a regression caused by implementation
Fariborz Jahanian [Thu, 13 Nov 2014 22:27:05 +0000 (22:27 +0000)]
Objective-C. Fixes a regression caused by implementation
of new warning for deprecated method call for receiver
of type 'id'. This addresses rdar://18960378 where
unintended warnings being issued.

llvm-svn: 221933

9 years agoAvoid usage of char16_t as MSVC "14" doesn't appear to support it
Reid Kleckner [Thu, 13 Nov 2014 22:09:56 +0000 (22:09 +0000)]
Avoid usage of char16_t as MSVC "14" doesn't appear to support it

Fixes the MSVC "14" build.

llvm-svn: 221932

9 years agoFix nested namespace with decltype to hopefully work with MSVC
David Blaikie [Thu, 13 Nov 2014 21:56:57 +0000 (21:56 +0000)]
Fix nested namespace with decltype to hopefully work with MSVC

Build failed here:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/14629/steps/build_Lld/logs/stdio

So I'm taking a shot in the dark that MSVC (whatever version that is)
can't cope with nested name specifiers with a decltype prefix.

llvm-svn: 221931

9 years agoMake a few helper functions static. NFC.
Rafael Espindola [Thu, 13 Nov 2014 21:54:59 +0000 (21:54 +0000)]
Make a few helper functions static. NFC.

llvm-svn: 221930

9 years ago[ASan] Really fix zero_page_pc test for PowerPC
Jay Foad [Thu, 13 Nov 2014 21:53:00 +0000 (21:53 +0000)]
[ASan] Really fix zero_page_pc test for PowerPC

Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.

On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).

On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.

You can see this difference if you run the test case under gdb.

Reviewers: kcc, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 221929

9 years agoUse unique_ptr to handle ownership of TreePatterns in CodeGenDAGPatterns::PatternFrag...
David Blaikie [Thu, 13 Nov 2014 21:40:02 +0000 (21:40 +0000)]
Use unique_ptr to handle ownership of TreePatterns in CodeGenDAGPatterns::PatternFragments

We might be able to use unique_ptr to handle ownership of the
TreePatternNodes too - looking into that next.

llvm-svn: 221928

9 years agoSpecify checksums properly for llgs test suite packets.
Stephane Sezer [Thu, 13 Nov 2014 21:39:24 +0000 (21:39 +0000)]
Specify checksums properly for llgs test suite packets.

Summary: These checksums are ignored by llgs but some implementations require them to be specified properly.

Test Plan: Re-run llgs tests with the checksums and make sure we don't break anything.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 221927

9 years agoWe can get the TLOF from the TargetMachine - so constructor no longer requires Target...
Aditya Nandakumar [Thu, 13 Nov 2014 21:29:21 +0000 (21:29 +0000)]
We can get the TLOF from the TargetMachine - so constructor no longer requires TargetLoweringObjectFile to be passed.

llvm-svn: 221926

9 years ago[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silentl...
Alexey Samsonov [Thu, 13 Nov 2014 21:19:53 +0000 (21:19 +0000)]
[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.

llvm-svn: 221925

9 years ago[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE.
Chad Rosier [Thu, 13 Nov 2014 21:17:58 +0000 (21:17 +0000)]
[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE.

Phabricator Revision: http://reviews.llvm.org/D6103
Patch by "Balaram Makam" <bmakam@codeaurora.org>!

llvm-svn: 221924

9 years ago[FastISel][AArch64] Don't bail during simple GEP instruction selection.
Juergen Ributzka [Thu, 13 Nov 2014 20:50:44 +0000 (20:50 +0000)]
[FastISel][AArch64] Don't bail during simple GEP instruction selection.

The generic FastISel code would bail, because it can't emit a sign-extend for
AArch64. This copies the code over and uses AArch64 specific emit functions.

This is not ideal and 'computeAddress' should handles this, so it can fold the
address computation into the memory operation.

I plan to clean up 'computeAddress' anyways, so I will add that in a future
commit.

Related to rdar://problem/18962471.

llvm-svn: 221923

9 years agoR600/SI: Use s_movk_i32
Matt Arsenault [Thu, 13 Nov 2014 20:44:23 +0000 (20:44 +0000)]
R600/SI: Use s_movk_i32

llvm-svn: 221922

9 years agoR600/SI: Fix definition for s_cselect_b32
Matt Arsenault [Thu, 13 Nov 2014 20:23:36 +0000 (20:23 +0000)]
R600/SI: Fix definition for s_cselect_b32

These were directly using the old base instruction
class, and specifying the wrong register classes
for operands. The operands can be the other special
inputs besides SGPRs. The op name was also being
directly used for the asm string, so this was printed
without any operands.

llvm-svn: 221921

9 years agoR600: Fix assert on empty function
Matt Arsenault [Thu, 13 Nov 2014 20:07:40 +0000 (20:07 +0000)]
R600: Fix assert on empty function

If a function is just an unreachable, this would hit a
"this is not a MachO target" assertion because of setting
HasSubsectionViaSymbols.

llvm-svn: 221920

9 years agoUn-break the big-endian buildbots
Rui Ueyama [Thu, 13 Nov 2014 20:07:06 +0000 (20:07 +0000)]
Un-break the big-endian buildbots

llvm-svn: 221919

9 years agoPR21437, final part of DR1330: delay-parsing of exception-specifications. This
Richard Smith [Thu, 13 Nov 2014 20:01:57 +0000 (20:01 +0000)]
PR21437, final part of DR1330: delay-parsing of exception-specifications. This
is a re-commit of Doug's r154844 (modernized and updated to fit into current
Clang).

llvm-svn: 221918

9 years agoR600: Error on initializer for LDS.
Matt Arsenault [Thu, 13 Nov 2014 19:56:13 +0000 (19:56 +0000)]
R600: Error on initializer for LDS.

Also give a proper error for other address spaces.

llvm-svn: 221917

9 years agoR600/SI: Get rid of FCLAMP_SI pseudo
Matt Arsenault [Thu, 13 Nov 2014 19:49:04 +0000 (19:49 +0000)]
R600/SI: Get rid of FCLAMP_SI pseudo

It's not necessary. Also use complex patterns to allow
src modifier usage.

llvm-svn: 221916

9 years agoObject, Mach-O: Refactor and clean code up
David Majnemer [Thu, 13 Nov 2014 19:48:56 +0000 (19:48 +0000)]
Object, Mach-O: Refactor and clean code up

Don't assert if we can return an error code, reuse existing
functionality like is64Bit().

llvm-svn: 221915

9 years agoRemove -Wcast-qual as it's inherited from llvm since r221913.
Roman Divacky [Thu, 13 Nov 2014 19:47:31 +0000 (19:47 +0000)]
Remove -Wcast-qual as it's inherited from llvm since r221913.

llvm-svn: 221914

9 years agoUse -Wcast-qual in cmake builds, not only autoconfo ones.
Roman Divacky [Thu, 13 Nov 2014 19:45:27 +0000 (19:45 +0000)]
Use -Wcast-qual in cmake builds, not only autoconfo ones.

llvm-svn: 221913

9 years agoRemoved r221896, it seems to break build in various ways.
Yury Gribov [Thu, 13 Nov 2014 19:37:30 +0000 (19:37 +0000)]
Removed r221896, it seems to break build in various ways.

llvm-svn: 221912

9 years agoR600/SI: Allow commuting with src2_modifiers
Matt Arsenault [Thu, 13 Nov 2014 19:26:50 +0000 (19:26 +0000)]
R600/SI: Allow commuting with src2_modifiers

llvm-svn: 221911

9 years agoR600/SI: Allow commuting some 3 op instructions
Matt Arsenault [Thu, 13 Nov 2014 19:26:47 +0000 (19:26 +0000)]
R600/SI: Allow commuting some 3 op instructions

e.g. v_mad_f32 a, b, c -> v_mad_f32 b, a, c

This simplifies matching v_madmk_f32.

This looks somewhat surprising, but it appears to be
OK to do this. We can commute src0 and src1 in all
of these instructions, and that's all that appears
to matter.

llvm-svn: 221910

9 years agoReturn word_t from read.
Rafael Espindola [Thu, 13 Nov 2014 18:44:53 +0000 (18:44 +0000)]
Return word_t from read.

This removes the need for a special Read64.

llvm-svn: 221909

9 years agoFixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the same...
Greg Clayton [Thu, 13 Nov 2014 18:30:06 +0000 (18:30 +0000)]
Fixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the same semantics as other SBDebugger::CreateTarget() functions.

The issues were:
- If you called this function with any arch other than the default target architecture, creating the target would fail because the Target::GetDefaultArchitecture() would not match the single architecture in the file specified. This caused running the test suite remotely with lldb-platform to fail many many tests due to the bad target.
- It would specify the currently selected platform which might not work for the specified platform

All other SBDebugger::CreateTarget calls do not assume an architecture or platform and if they aren't specified, they don't auto select the wrong one for you.

With this fix, SBTarget SBDebugger::CreateTarget (const char *filename) now behaves like the other SBDebugger::CreateTarget() variants.

llvm-svn: 221908

9 years agoRemove extra "/" character from paths resolved in iOS SDKs and also be sure to update...
Greg Clayton [Thu, 13 Nov 2014 18:25:33 +0000 (18:25 +0000)]
Remove extra "/" character from paths resolved in iOS SDKs and also be sure to update the SDK directory infos if needed before we start using m_sdk_directory_infos.

llvm-svn: 221907

9 years agoRefactor NativeProcessLinux::AttachToProcess in order to avoid reinterpret_cast from...
Oleksiy Vyalov [Thu, 13 Nov 2014 18:22:16 +0000 (18:22 +0000)]
Refactor NativeProcessLinux::AttachToProcess in order to avoid reinterpret_cast from NativeProcessProtocol* to NativeProcessLinux*.

llvm-svn: 221906

9 years agoARM: allow constpool entry to be moved to the user's block in all cases.
Tim Northover [Thu, 13 Nov 2014 17:58:53 +0000 (17:58 +0000)]
ARM: allow constpool entry to be moved to the user's block in all cases.

Normally entries can only move to a lower address, but when that wasn't viable,
the user's block was considered anyway. Unfortunately, it went via
createNewWater which wasn't designed to handle the case where there's already
an island after the block.

Unfortunately, the test we have is slow and fragile, and I couldn't reduce it
to anything sane even with the @llvm.arm.space intrinsic. The test change here
is recreating the previous one after the change.

rdar://problem/18545506

llvm-svn: 221905

9 years agoARM: avoid duplicating branches during constant islands.
Tim Northover [Thu, 13 Nov 2014 17:58:51 +0000 (17:58 +0000)]
ARM: avoid duplicating branches during constant islands.

We were using a naive heuristic to determine whether a basic block already had
an unconditional branch at the end. This mostly corresponded to reality
(assuming branches got optimised) because there's not much point in a branch to
the next block, but could go wrong.

llvm-svn: 221904

9 years agoARM: add @llvm.arm.space intrinsic for testing ConstantIslands.
Tim Northover [Thu, 13 Nov 2014 17:58:48 +0000 (17:58 +0000)]
ARM: add @llvm.arm.space intrinsic for testing ConstantIslands.

Creating tests for the ConstantIslands pass is very difficult, since it depends
on precise layout details. Having the ability to precisely inject a number of
bytes into the stream helps greatly.

llvm-svn: 221903

9 years agoFix the other build system.
Rafael Espindola [Thu, 13 Nov 2014 17:12:19 +0000 (17:12 +0000)]
Fix the other build system.

llvm-svn: 221901

9 years agoHook up FreeBSD AArch64 support
Ed Maste [Thu, 13 Nov 2014 16:55:42 +0000 (16:55 +0000)]
Hook up FreeBSD AArch64 support

Patch from Andrew Turner.

llvm-svn: 221900

9 years agoFix a regression on the disassembling C API.
Rafael Espindola [Thu, 13 Nov 2014 16:52:07 +0000 (16:52 +0000)]
Fix a regression on the disassembling C API.

The fix is easy. Unfortunately, we had 0 tests, so adding one was somewhat
complicated.

Thanks to Kevin Enderby for the report.

llvm-svn: 221899

9 years ago[Hexagon]
Colin LeMahieu [Thu, 13 Nov 2014 16:36:30 +0000 (16:36 +0000)]
[Hexagon]
NFC Renaming reserved identifier.

llvm-svn: 221898

9 years agoclang-format: Format extern "C" blocks like namespace blocks.
Nico Weber [Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)]
clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.

Before,

  extern "C" {

  void ExternCFunction();

  }

was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.

Fixes http://crbug.com/432640 and part of PR21419.

llvm-svn: 221897

9 years ago[ASan] Add process basename to log name and error message to simplify analysis of...
Yury Gribov [Thu, 13 Nov 2014 16:01:23 +0000 (16:01 +0000)]
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.

Reviewed at http://reviews.llvm.org/D5724

llvm-svn: 221896

9 years agoclang-format: [Java] Support Java enums.
Daniel Jasper [Thu, 13 Nov 2014 15:56:28 +0000 (15:56 +0000)]
clang-format: [Java] Support Java enums.

In Java, enums can contain a class body and enum constants can have
arguments as well as class bodies. Support most of that.

llvm-svn: 221895

9 years ago[Reassociate] Update comment. NFC.
Chad Rosier [Thu, 13 Nov 2014 15:40:20 +0000 (15:40 +0000)]
[Reassociate] Update comment. NFC.

llvm-svn: 221894

9 years ago[Mips] Add comment to the test case
Simon Atanasyan [Thu, 13 Nov 2014 15:29:37 +0000 (15:29 +0000)]
[Mips] Add comment to the test case

No functional changes.

llvm-svn: 221893

9 years agoSimplify code a bit. NFC.
Rafael Espindola [Thu, 13 Nov 2014 14:45:22 +0000 (14:45 +0000)]
Simplify code a bit. NFC.

Thanks to Sean Silva for the suggestion.

llvm-svn: 221892

9 years agoSmall optimization: once the size is know, we don't have to call fillCurWord.
Rafael Espindola [Thu, 13 Nov 2014 14:37:51 +0000 (14:37 +0000)]
Small optimization: once the size is know, we don't have to call fillCurWord.

llvm-svn: 221891

9 years ago[ELF] Fix the fileoffset according to the ELF spec.
Shankar Easwaran [Thu, 13 Nov 2014 14:30:21 +0000 (14:30 +0000)]
[ELF] Fix the fileoffset according to the ELF spec.

With --no-align-segments, there is a bug that the fileoffset may not be
congruent to virtual address modulo page alignment.

This patch fixes the problem.

llvm-svn: 221890

9 years agoDelete empty test/missing directory
Simon Atanasyan [Thu, 13 Nov 2014 14:13:12 +0000 (14:13 +0000)]
Delete empty test/missing directory

llvm-svn: 221889

10 years agoFixing -Wtype-limits warnings with the asserts (the expression would always evaluate...
Aaron Ballman [Thu, 13 Nov 2014 13:55:13 +0000 (13:55 +0000)]
Fixing -Wtype-limits warnings with the asserts (the expression would always evaluate to true). Also fixing a -Wcast-qual warning, where the cast expression isn't required.

llvm-svn: 221888

10 years agoFixing some sign comparison warnings from MSVC; NFC.
Aaron Ballman [Thu, 13 Nov 2014 13:39:49 +0000 (13:39 +0000)]
Fixing some sign comparison warnings from MSVC; NFC.

llvm-svn: 221887