platform/upstream/llvm.git
8 years ago[X86][AVX512] Regenerated mask op tests
Simon Pilgrim [Sun, 10 Apr 2016 14:16:03 +0000 (14:16 +0000)]
[X86][AVX512] Regenerated mask op tests

llvm-svn: 265898

8 years ago[OCaml] Expose the LLVM diagnostic handler
Jeroen Ketema [Sun, 10 Apr 2016 13:55:53 +0000 (13:55 +0000)]
[OCaml] Expose the LLVM diagnostic handler

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

llvm-svn: 265897

8 years agoAdding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to...
Michael Zuckerman [Sun, 10 Apr 2016 12:54:23 +0000 (12:54 +0000)]
Adding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to clang

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

llvm-svn: 265896

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang
Michael Zuckerman [Sun, 10 Apr 2016 10:51:04 +0000 (10:51 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang

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

llvm-svn: 265895

8 years agoAllow pointer expressions in SCEVs again.
Johannes Doerfert [Sun, 10 Apr 2016 09:50:10 +0000 (09:50 +0000)]
Allow pointer expressions in SCEVs again.

  In r247147 we disabled pointer expressions because the IslExprBuilder did not
  fully support them. This patch reintroduces them by simply treating them as
  integers. The only special handling for pointers that is left detects the
  comparison of two address_of operands and uses an unsigned compare.

llvm-svn: 265894

8 years ago[X86] Use for loops over types to reduce code for setting up operation actions.
Craig Topper [Sun, 10 Apr 2016 05:39:32 +0000 (05:39 +0000)]
[X86] Use for loops over types to reduce code for setting up operation actions.

llvm-svn: 265893

8 years ago[X86] Remove unnecessary setOperationAction for SRA v2i64/v4i64 when VLX is suppored...
Craig Topper [Sun, 10 Apr 2016 05:39:28 +0000 (05:39 +0000)]
[X86] Remove unnecessary setOperationAction for SRA v2i64/v4i64 when VLX is suppored. This is already done for SSE2/AVX2 which VLX implies. NFC

llvm-svn: 265892

8 years agoFix asan test failure
Xinliang David Li [Sun, 10 Apr 2016 05:31:29 +0000 (05:31 +0000)]
Fix asan test failure

llvm-svn: 265891

8 years ago[PGO] Fix deserialize bug
Xinliang David Li [Sun, 10 Apr 2016 03:32:02 +0000 (03:32 +0000)]
[PGO] Fix deserialize bug

Raw function pointer collected by value
profile data may be from external functions
that are not instrumented. They won't have
mapping data to be used by the deserializer.
Force the value to be 0 in this case.

llvm-svn: 265890

8 years agotest: add additional tests for SVN r265888
Saleem Abdulrasool [Sun, 10 Apr 2016 03:31:09 +0000 (03:31 +0000)]
test: add additional tests for SVN r265888

Add test cases for AArch64 as well as that was changed as part of that change.

llvm-svn: 265889

8 years agoAdd support for __gnu_mcount_nc as the pg interface
Saleem Abdulrasool [Sun, 10 Apr 2016 03:19:47 +0000 (03:19 +0000)]
Add support for __gnu_mcount_nc as the pg interface

This adds support to optionally support using `__gnu_mcount_nc` as the mcount
interface rather than `mcount` for Linux and EABI.  The other targets do not
provide an implementation for `__gnu_mcount_nc`.  This can be activated via the
`-meabi gnu` flag.

Resolves PR23969.

llvm-svn: 265888

8 years agoClean up test case
Xinliang David Li [Sun, 10 Apr 2016 02:35:53 +0000 (02:35 +0000)]
Clean up test case

llvm-svn: 265887

8 years ago[CodeGen] Don't assume that fixed stack objects are aligned in a stack-realigned...
Charles Davis [Sat, 9 Apr 2016 23:34:42 +0000 (23:34 +0000)]
[CodeGen] Don't assume that fixed stack objects are aligned in a stack-realigned function.

Summary:
After we make the adjustment, we can assume that for local allocas, but
not for stack parameters, the return address, or any other fixed stack
object (which has a negative offset and therefore lies prior to the
adjusted SP).

Fixes PR26662.

Reviewers: hfinkel, qcolombet, rnk

Subscribers: rnk, llvm-commits

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

llvm-svn: 265886

8 years ago[COFF] SmallVector<char, 0> -> SmallString<0>.
Davide Italiano [Sat, 9 Apr 2016 23:00:31 +0000 (23:00 +0000)]
[COFF] SmallVector<char, 0> -> SmallString<0>.

This way we're consistent between ELF and COFF.

llvm-svn: 265885

8 years ago[FIX] Do not allow select as a base pointer in the SCoP region
Johannes Doerfert [Sat, 9 Apr 2016 21:57:13 +0000 (21:57 +0000)]
[FIX] Do not allow select as a base pointer in the SCoP region

llvm-svn: 265884

8 years agoDo not allow exception handling code in SCoPs
Johannes Doerfert [Sat, 9 Apr 2016 21:55:58 +0000 (21:55 +0000)]
Do not allow exception handling code in SCoPs

llvm-svn: 265883

8 years agoAdd __isl_give annotations to return types [NFC]
Johannes Doerfert [Sat, 9 Apr 2016 21:55:23 +0000 (21:55 +0000)]
Add __isl_give annotations to return types [NFC]

llvm-svn: 265882

8 years ago[MC] support TLSDESC and TLSCALL / GNU2 tls dialect
Davide Italiano [Sat, 9 Apr 2016 20:32:33 +0000 (20:32 +0000)]
[MC] support TLSDESC and TLSCALL / GNU2 tls dialect

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

llvm-svn: 265881

8 years agoFix hash_integer_value
JF Bastien [Sat, 9 Apr 2016 20:25:02 +0000 (20:25 +0000)]
Fix hash_integer_value

Broken in D18938 because underlying_type only works for enums and not all stdlibs are sad when given a non-enum. Bots error out with 'only enumeration types have underlying types'.

There's probably a clever enable_if-ism that I can do with underlying_type and the actual integer value, but is_integral_or_enum also accepts implicit conversion so I need to ponder my life choices a bit before committing to template magic. A quick fix for now.

llvm-svn: 265880

8 years agois_integral_or_enum ❥ enum class ⇒ hashable enum class
JF Bastien [Sat, 9 Apr 2016 20:04:34 +0000 (20:04 +0000)]
is_integral_or_enum ❥ enum class ⇒ hashable enum class

Summary:
As discussed in D18775 making AtomicOrdering an enum class makes it non-hashable, which shouldn't be the case. Hashing.h defines hash_value for all is_integral_or_enum, but type_traits.h's definition of is_integral_or_enum only checks for *inplicit* conversion to integral types which leaves enum classes out and is very confusing because is_enum is true for enum classes.

This patch:
  - Adds a check for is_enum when determining is_integral_or_enum.
  - Explicitly converts the value parameter in hash_value to handle enum class hashing.

Note that the warning at the top of Hashing.h still applies: each execution of the program has a high probability of producing a different hash_code for a given input. Thus their values are not stable to save or persist, and should only be used during the execution for the construction of hashing datastructures.

Reviewers: dberlin, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 265879

8 years agoBasic: thread TargetOptions into TargetInfo
Saleem Abdulrasool [Sat, 9 Apr 2016 19:09:25 +0000 (19:09 +0000)]
Basic: thread TargetOptions into TargetInfo

This threads TargetOptions into the TargetInfo hierarchy.  This is a rework of
the original attempt to thread additional information into the TargetInfo to
make decisions based on additional ABI related options.

llvm-svn: 265878

8 years agoObjC kindof: check the context when inserting methods to global pool.
Manman Ren [Sat, 9 Apr 2016 18:59:48 +0000 (18:59 +0000)]
ObjC kindof: check the context when inserting methods to global pool.

To make kindof lookup work, we need to insert methods with different
context into the global pool, even though they have the same siganture.

Since diagnosis of availability is performed on the best candidate,
which is often the first candidate from the global pool, we prioritize
the methods that are unavaible or deprecated to the head of the list.

Since we now have more methods in the global pool, we need to watch
out for performance impact.

rdar://25635831

llvm-svn: 265877

8 years agoDrop debug info for DISubprograms that are not referenced by anything
Adrian Prantl [Sat, 9 Apr 2016 18:10:22 +0000 (18:10 +0000)]
Drop debug info for DISubprograms that are not referenced by anything

This patch drops the debug info for all DISubprograms that are
(a) not attached to an llvm::Function and
(b) not indirectly reachable via inline scopes from any surviving Function and
(c) not reachable from a type (i.e.: member functions).

Background: I'm currently working on a patch to reverse the pointers
between DICompileUnit and DISubprogram (for more info check Duncan's RFC
on lazy-loading of debug info metadata
http://lists.llvm.org/pipermail/llvm-dev/2016-March/097419.html).
The idea is to remove the list of subprograms from DICompileUnit and
instead point to the owning compile unit from each DISubprogram.
After doing this all DISubprograms fulfilling the above criteria will be
implicitly dropped unless we go through an extra effort to preserve them.

http://reviews.llvm.org/D18477
<rdar://problem/25256815>

llvm-svn: 265876

8 years ago[x86] use BMI 'andn' for logic + compare ops
Sanjay Patel [Sat, 9 Apr 2016 16:02:52 +0000 (16:02 +0000)]
[x86] use BMI 'andn' for logic + compare ops

With BMI, we can use 'andn' to save an instruction when the result is only used in a compare.
This is related to one of the potential sequences to check 'isfinite' in:
https://llvm.org/bugs/show_bug.cgi?id=27164

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

llvm-svn: 265875

8 years ago[X86][XOP] Support for VPPERM 2-input shuffle mask decoding
Simon Pilgrim [Sat, 9 Apr 2016 14:51:26 +0000 (14:51 +0000)]
[X86][XOP] Support for VPPERM 2-input shuffle mask decoding

This patch adds support for decoding XOP VPPERM instruction when it represents a basic shuffle.

The mask decoding required the existing MCInstrLowering code to be updated to support binary shuffles - the implementation now matches what is done in X86InstrComments.cpp.

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

llvm-svn: 265874

8 years ago[FIX] Do not recompute SCEVs but pass them to subfunctions
Johannes Doerfert [Sat, 9 Apr 2016 14:30:11 +0000 (14:30 +0000)]
[FIX] Do not recompute SCEVs but pass them to subfunctions

  This reverts commit 2879c53e80e05497f408f21ce470d122e9f90f94.
  Additionally, it adds SDiv and SRem instructions to the set of values
  discovered by the findValues function even if we add the operands to
  be able to recompute the SCEVs. In subfunctions we do not want to
  recompute SDiv and SRem instructions but pass them instead as they
  might have been created through the IslExprBuilder and are more
  complicated than simple SDiv/SRem instructions in the code.

llvm-svn: 265873

8 years agoFix: Always honor LLVM_LIBDIR_SUFFIX.
Michael Kruse [Sat, 9 Apr 2016 14:09:08 +0000 (14:09 +0000)]
Fix: Always honor LLVM_LIBDIR_SUFFIX.

Static libraries where installed into "lib${LLVM_LIBDIR_SUFFIX}" while
shared ones into "lib". I found no justification for this behaviour.
This patch changes both types of libraries to be install into
"lib${LLVM_LIBDIR_SUFFIX}". LLVM and clang use the same behaviour.

This fixes llvm.org/PR27305.

llvm-svn: 265872

8 years ago[X86] Use for loops over types to reduce code for setting up operation actions. NFC
Craig Topper [Sat, 9 Apr 2016 06:31:02 +0000 (06:31 +0000)]
[X86] Use for loops over types to reduce code for setting up operation actions. NFC

llvm-svn: 265871

8 years ago[X86] Remove calls to setOperationAction that set CTLZ_ZERO_UNDEF for some vector...
Craig Topper [Sat, 9 Apr 2016 05:53:48 +0000 (05:53 +0000)]
[X86] Remove calls to setOperationAction that set CTLZ_ZERO_UNDEF for some vector types to Expand. Expand is already set for all operations for all vector types earlier so this is redundant. NFC

llvm-svn: 265870

8 years agoFix TestBreakpointSetRestart failure on Android.
Oleksiy Vyalov [Sat, 9 Apr 2016 03:08:02 +0000 (03:08 +0000)]
Fix TestBreakpointSetRestart failure on Android.

llvm-svn: 265869

8 years ago[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS
Nathan Wilson [Sat, 9 Apr 2016 02:55:27 +0000 (02:55 +0000)]
[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS

Summary: A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition.

Reviewers: rsmith, hubert.reinterpretcast, faisalv, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 265868

8 years agoMaintain calling convention when inling calls to llvm.deoptimize
Sanjoy Das [Sat, 9 Apr 2016 00:22:59 +0000 (00:22 +0000)]
Maintain calling convention when inling calls to llvm.deoptimize

The behavior here was buggy -- we'd forget the calling convention after
inlining a callsite calling llvm.deoptimize.

llvm-svn: 265867

8 years ago[libfuzzer] defensive assert
Mike Aizatsky [Fri, 8 Apr 2016 23:32:24 +0000 (23:32 +0000)]
[libfuzzer] defensive assert

llvm-svn: 265866

8 years agoRemove what I believe are the last known instances of formatters that run code
Enrico Granata [Fri, 8 Apr 2016 22:49:31 +0000 (22:49 +0000)]
Remove what I believe are the last known instances of formatters that run code

llvm-svn: 265865

8 years ago[Perf-Training] Reworked workflow improvements for order-file generation
Chris Bieneman [Fri, 8 Apr 2016 22:48:18 +0000 (22:48 +0000)]
[Perf-Training] Reworked workflow improvements for order-file generation

This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64.

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

llvm-svn: 265864

8 years ago[CMake] Make llvm_ExternalProject always call the build action
Chris Bieneman [Fri, 8 Apr 2016 22:46:04 +0000 (22:46 +0000)]
[CMake] Make llvm_ExternalProject always call the build action

This makes it so that when running 'ninja test-suite' from the top-level LLVM ninja build it *always* re-runs the ninja command in the test-suite directory.

This mechanism is required because the top-level ninja file doesn't have a view into the subdirectory dependency tree, so it can't know what, if anything, needs to be rebuilt.

llvm-svn: 265863

8 years agoUse NoDebug compile units to mark debug metadata used only for sample-based
Adrian Prantl [Fri, 8 Apr 2016 22:43:06 +0000 (22:43 +0000)]
Use NoDebug compile units to mark debug metadata used only for sample-based
profiling and optimization remarks and indicate that no debug info shall
be emitted for these compile units.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

llvm-svn: 265862

8 years agoSupport the Nodebug emission kind for DICompileUnits.
Adrian Prantl [Fri, 8 Apr 2016 22:43:03 +0000 (22:43 +0000)]
Support the Nodebug emission kind for DICompileUnits.

Sample-based profiling and optimization remarks currently remove
DICompileUnits from llvm.dbg.cu to suppress the emission of debug info
from them. This is somewhat of a hack and only borderline legal IR.

This patch uses the recently introduced NoDebug emission kind in
DICompileUnit to achieve the same result without breaking the Verifier.
A nice side-effect of this change is that it is now possible to combine
NoDebug and regular compile units under LTO.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

llvm-svn: 265861

8 years agobenchcomp: Add a mode for analyzing rule execution time in ninja log files.
Peter Collingbourne [Fri, 8 Apr 2016 22:42:22 +0000 (22:42 +0000)]
benchcomp: Add a mode for analyzing rule execution time in ninja log files.

llvm-svn: 265860

8 years agobenchcomp: Look at all sections whose names begin with .text, not just the .text...
Peter Collingbourne [Fri, 8 Apr 2016 22:42:14 +0000 (22:42 +0000)]
benchcomp: Look at all sections whose names begin with .text, not just the .text section.

llvm-svn: 265859

8 years ago-thread-info in lldbmi does not conform to protocol. Should end with current thread id
Chuck Ries [Fri, 8 Apr 2016 22:17:53 +0000 (22:17 +0000)]
-thread-info in lldbmi does not conform to protocol. Should end with current thread id

-thread-info in lldbmi does not conform to protocol. Should end with
current thread id as described here:
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands

When printing all threads, the current thread id should be printed
afterwards.

Example:
-thread-info
     ^done,threads=[
     {id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",
        frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",
                args=[]},state="running"},
     {id="1",target-id="Thread 0xb7e156b0 (LWP 21254)",
        frame={level="0",addr="0x0804891f",func="foo",
                args=[{name="i",value="10"}],
                file="/tmp/a.c",fullname="/tmp/a.c",line="158"},
                state="running"}],
     current-thread-id="1"
     (gdb)

Patch from jacdavis@microsoft.com

Reviewers: zturner, chuckr

Differential Revision: http://reviews.llvm.org/differential/revision/edit/18880/

llvm-svn: 265858

8 years agoRemove unused functions from ASTWriter interface.
Richard Smith [Fri, 8 Apr 2016 21:54:32 +0000 (21:54 +0000)]
Remove unused functions from ASTWriter interface.

llvm-svn: 265857

8 years agoUpdate filesystem status
Eric Fiselier [Fri, 8 Apr 2016 21:52:32 +0000 (21:52 +0000)]
Update filesystem status

llvm-svn: 265856

8 years agofix documentation comments; NFC
Sanjay Patel [Fri, 8 Apr 2016 21:42:43 +0000 (21:42 +0000)]
fix documentation comments; NFC

llvm-svn: 265855

8 years agoFix another crash bug in --start-lib.
Rui Ueyama [Fri, 8 Apr 2016 21:38:22 +0000 (21:38 +0000)]
Fix another crash bug in --start-lib.

The previous fix didn't work for bitcode files. This patch fixes
the remaining issue.

llvm-svn: 265854

8 years agoAdd an interesting test case we already pass.
Rafael Espindola [Fri, 8 Apr 2016 21:33:04 +0000 (21:33 +0000)]
Add an interesting test case we already pass.

We had no tests for the interaction of relocations pointing to tail
merged strings.

llvm-svn: 265853

8 years agoRefactor Threshold computation. NFC.
Easwaran Raman [Fri, 8 Apr 2016 21:28:02 +0000 (21:28 +0000)]
Refactor Threshold computation. NFC.

This is part of changes reviewed in http://reviews.llvm.org/D17584.

llvm-svn: 265852

8 years ago[SSP] Remove llvm.stackprotectorcheck.
Tim Shen [Fri, 8 Apr 2016 21:26:31 +0000 (21:26 +0000)]
[SSP] Remove llvm.stackprotectorcheck.

This is a cleanup patch for SSP support in LLVM. There is no functional change.
llvm.stackprotectorcheck is not needed, because SelectionDAG isn't
actually lowering it in SelectBasicBlock; rather, it adds check code in
FinishBasicBlock, ignoring the position where the intrinsic is inserted
(See FindSplitPointForStackProtector()).

llvm-svn: 265851

8 years ago[x86] show missed opportunities to use andn
Sanjay Patel [Fri, 8 Apr 2016 21:26:11 +0000 (21:26 +0000)]
[x86] show missed opportunities to use andn

llvm-svn: 265850

8 years agoRemove even more of the data formatters that silently run code
Enrico Granata [Fri, 8 Apr 2016 21:24:24 +0000 (21:24 +0000)]
Remove even more of the data formatters that silently run code

Fixes <rdar://problem/25629755>

llvm-svn: 265849

8 years agoPR25501: Delay loading visible updates for a declaration until after we've
Richard Smith [Fri, 8 Apr 2016 20:53:26 +0000 (20:53 +0000)]
PR25501: Delay loading visible updates for a declaration until after we've
processed update records. If an update record adds a definition, we need to
merge that with any pre-existing definition to determine which the canonical
definition is before we apply the visible update, otherwise we wouldn't know
where to apply it.

Thanks to Vassil Vassilev for help reducing this and tracking down the problem.

llvm-svn: 265848

8 years agoFix a crash bug in --start-lib.
Rui Ueyama [Fri, 8 Apr 2016 20:49:31 +0000 (20:49 +0000)]
Fix a crash bug in --start-lib.

Previously, Lazy symbols were created for undefined symbols even though
such symbols cannot be resolved by loading object files. This patch
fixes that bug.

llvm-svn: 265847

8 years agoRangeify a loop. NFC.
Hans Wennborg [Fri, 8 Apr 2016 20:46:09 +0000 (20:46 +0000)]
Rangeify a loop. NFC.

llvm-svn: 265846

8 years agoRemove some redundant variables from X86TargetLowering::LowerDYNAMIC_STACKALLOC
Hans Wennborg [Fri, 8 Apr 2016 20:46:00 +0000 (20:46 +0000)]
Remove some redundant variables from X86TargetLowering::LowerDYNAMIC_STACKALLOC

These are already defined, with the same values, a few lines up. NFC.

llvm-svn: 265845

8 years agoAdd doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics...
Ekaterina Romanova [Fri, 8 Apr 2016 20:45:48 +0000 (20:45 +0000)]
Add doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson.

llvm-svn: 265844

8 years agoReset continue_after_async only if neither SIGINIT nor SIGSTOP received.
Oleksiy Vyalov [Fri, 8 Apr 2016 20:44:28 +0000 (20:44 +0000)]
Reset continue_after_async only if neither SIGINIT nor SIGSTOP received.

http://reviews.llvm.org/D18886

llvm-svn: 265843

8 years agoCodegen: Factor tail duplication into a utility class. NFC
Kyle Butt [Fri, 8 Apr 2016 20:35:01 +0000 (20:35 +0000)]
Codegen: Factor tail duplication into a utility class. NFC

This is in preparation for tail duplication during block placement. See D18226.
This needs to be a utility class for 2 reasons. No passes may run after block
placement, and also, tail-duplication affects subsequent layout decisions, so
it must be interleaved with placement, and can't be separated out into its own
pass. The original pass is still useful, and now runs by delegating to the
utility class.

llvm-svn: 265842

8 years ago[x86] regenerate checks for BMI tests
Sanjay Patel [Fri, 8 Apr 2016 20:29:39 +0000 (20:29 +0000)]
[x86] regenerate checks for BMI tests

llvm-svn: 265841

8 years agotest commit
Evgeny Stupachenko [Fri, 8 Apr 2016 20:20:38 +0000 (20:20 +0000)]
test commit

llvm-svn: 265840

8 years ago[analyzer] Teach trackNullOrUndefValue about calls to property accessors.
Devin Coughlin [Fri, 8 Apr 2016 19:59:16 +0000 (19:59 +0000)]
[analyzer] Teach trackNullOrUndefValue about calls to property accessors.

Teach trackNullOrUndefValue() how to look through PseudoObjectExprs to find
the underlying method call for property getters. This makes over-suppression
of 'return nil' in getters consistent with the similar over-suppression for
method and function calls.

rdar://problem/24437252

llvm-svn: 265839

8 years ago[modules] Handle merged fields in designated initializers.
Richard Smith [Fri, 8 Apr 2016 19:57:40 +0000 (19:57 +0000)]
[modules] Handle merged fields in designated initializers.

llvm-svn: 265838

8 years agoAdd trailing colons to labels in a test.
James Y Knight [Fri, 8 Apr 2016 19:49:03 +0000 (19:49 +0000)]
Add trailing colons to labels in a test.

This will avoid matching on the FILENAME if it happened to contain, say,
"f4" anywhere in the file path.

llvm-svn: 265837

8 years agoFix Load Control Dependence in MemCpy Generation
Nirav Dave [Fri, 8 Apr 2016 19:44:40 +0000 (19:44 +0000)]
Fix Load Control Dependence in MemCpy Generation

In Memcpy lowering we had missed a dependence from the load of the
operation to successor operations. This causes us to potentially
construct an in initial DAG with a memory dependence not fully
represented in the chain sub-DAG but rather require looking at the
entire DAG breaking alias analysis by allowing incorrect repositioning
of memory operations.

To work around this, r200033 changed DAGCombiner::GatherAllAliases to be
conservative if any possible issues to happen. Unfortunately this check
forbade many non-problematic situations as well. For example, it's
common for incoming argument lowering to add a non-aliasing load hanging
off of EntryNode. Then, if GatherAllAliases visited EntryNode, it would
find that other (unvisited) use of the EntryNode chain, and just give up
entirely. Furthermore, the check was incomplete: it would not actually
detect all such potentially problematic DAG constructions, because
GatherAllAliases did not guarantee to visit all chain nodes going up to
the root EntryNode. This is in general fine -- giving up early will just
miss a potential optimization, not generate incorrect results. But, for
this non-chain dependency detection code, it's possible that you could
have a load attached to a higher-up chain node than any which were
visited. If that load aliases your store, but the only dependency is
through the value operand of a non-aliasing store, it would've been
missed by this code, and potentially reordered.

With the dependence added, this check can be removed and Alias Analysis
can be much more aggressive. This fixes code quality regression in the
Consecutive Store Merge cleanup (D14834).

Test Change:

ppc64-align-long-double.ll now may see multiple serializations
of its stores

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

llvm-svn: 265836

8 years agoValueMapper: Extract llvm::RemapFunction from IRMover.cpp, NFC
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 19:26:32 +0000 (19:26 +0000)]
ValueMapper: Extract llvm::RemapFunction from IRMover.cpp, NFC

Strip out the remapping parts of IRLinker::linkFunctionBody and put them
in ValueMapper.cpp under the name Mapper::remapFunction (with a
top-level entry-point llvm::RemapFunction).

This is a nice cleanup on its own since it puts the remapping code
together and shares a single Mapper context for the entire
IRLinker::linkFunctionBody Call.  Besides that, this will make it easier
to break the co-recursion between IRMover.cpp and ValueMapper.cpp in
follow ups.

llvm-svn: 265835

8 years ago[FIX] Do not crash on opaque (unsized) types.
Johannes Doerfert [Fri, 8 Apr 2016 19:20:03 +0000 (19:20 +0000)]
[FIX] Do not crash on opaque (unsized) types.

llvm-svn: 265834

8 years agoValueMapper: Always use Mapper::mapValue from remapInstruction, NFCI
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 19:17:13 +0000 (19:17 +0000)]
ValueMapper: Always use Mapper::mapValue from remapInstruction, NFCI

Use Mapper::mapValue instead of llvm::MapValue from
Mapper::remapInstruction when mapping an incoming block for a PHINode
(follow-up to r265832).  This will implicitly pass along the
Materializer argument, but when this code was added in r133513 there was
no Materializer argument.  I suspect this call to MapValue was just
missed in r182776 since it's not observable (basic blocks can't be
materialized, and they don't reference other values).

llvm-svn: 265833

8 years agoValueMapper: Roll RemapInstruction into Mapper, NFC
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 19:09:34 +0000 (19:09 +0000)]
ValueMapper: Roll RemapInstruction into Mapper, NFC

Add Mapper::remapInstruction, move the guts of llvm::RemapInstruction
into it, and use the same Mapper for most of the calls to MapValue and
MapMetadata.  There should be no functionality change here.

I left off the call to MapValue that wasn't passing in a Materializer
argument (for basic blocks of PHINodes).  It shouldn't change
functionality either, but I'm suspicious enough to commit separately.

llvm-svn: 265832

8 years agoLinker: Always pass RF_IgnoreMissingLocals; NFC
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 19:01:38 +0000 (19:01 +0000)]
Linker: Always pass RF_IgnoreMissingLocals; NFC

This is a cleanup after clarifying the meaning of RF_IgnoreMissingLocals
in r265628 and truly limiting it to locals in r265768.

This should have no functionality change, since the only context that
the flag has an effect is when we could hit function-local Value and
Metadata, and we were already passing it in those contexts.

llvm-svn: 265831

8 years ago[X86] Fix PR23155 by turning on X86FixupBWInsts by default.
Kevin B. Smith [Fri, 8 Apr 2016 18:58:29 +0000 (18:58 +0000)]
[X86] Fix PR23155 by turning on X86FixupBWInsts by default.
Differential Revision: http://reviews.llvm.org/D18866

llvm-svn: 265830

8 years agoFix #ifdef __APPLE__ code is the swig Python bindings
Todd Fiala [Fri, 8 Apr 2016 18:58:07 +0000 (18:58 +0000)]
Fix #ifdef __APPLE__ code is the swig Python bindings

This code was getting evaluated unintentionally at binding
generation time instead of binding file compilation time.

Addresses:
https://bugs.swift.org/browse/SR-1192

llvm-svn: 265829

8 years agoValueMapper: Don't memoize metadata when RF_NoModuleLevelChanges
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 18:49:36 +0000 (18:49 +0000)]
ValueMapper: Don't memoize metadata when RF_NoModuleLevelChanges

Prevent the Metadata side-table in ValueMap from growing unnecessarily
when RF_NoModuleLevelChanges.  As a drive-by, make ValueMap::hasMD,
which apparently had no users until I used it here for testing, actually
compile.

llvm-svn: 265828

8 years agoValueMapper: Stop memoizing MDStrings
Duncan P. N. Exon Smith [Fri, 8 Apr 2016 18:47:02 +0000 (18:47 +0000)]
ValueMapper: Stop memoizing MDStrings

Stop adding MDString to the Metadata section of the ValueMap in
MapMetadata.  It blows up the size of the map for no benefit, since we
can always return quickly anyway.

There is a potential follow-up that I don't think I'll push on right
away, but maybe someone else is interested:  stop checking for a
pre-mapped MDString, and move the `isa<MDString>()` checks in
Mapper::mapSimpleMetadata and MDNodeMapper::getMappedOp in front of the
`VM.getMappedMD()` calls.  While this would preclude explicitly
remapping MDStrings it would probably be a little faster.

llvm-svn: 265827

8 years agoCleanup the handling of MustBeInDynSym and IsUsedInRegularObj.
Rafael Espindola [Fri, 8 Apr 2016 18:39:03 +0000 (18:39 +0000)]
Cleanup the handling of MustBeInDynSym and IsUsedInRegularObj.

Now MustBeInDynSym is only true if the symbol really must be in the
dynamic symbol table.

IsUsedInRegularObj is only true if the symbol is used in a .o or -u. Not
a .so or a .bc.

A benefit is that this is now done almost entirilly during symbol
resolution. The only exception is copy relocations because of aliases.

This includes a small fix in that protected symbols in .so don't force
executable symbols to be exported.

This also opens the way for implementing internalize for -shared.

llvm-svn: 265826

8 years agoPropagate Undef in llvm.cos Intrinsic
Sanjoy Das [Fri, 8 Apr 2016 18:21:11 +0000 (18:21 +0000)]
Propagate Undef in llvm.cos Intrinsic

Summary:
The llvm cos intrinsic currently does not propagate undef's. This change
transforms cos(undef) to null value or 0.

There are 2 test cases added as well.

Patch by Anna Thomas!

Reviewers: sanjoy

Subscribers: majnemer, llvm-commits

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

llvm-svn: 265825

8 years ago[FIX] Teach the ScopExpander about parallel subfunctions
Johannes Doerfert [Fri, 8 Apr 2016 18:16:58 +0000 (18:16 +0000)]
[FIX] Teach the ScopExpander about parallel subfunctions

llvm-svn: 265824

8 years agoCollect and verify generated parallel subfunctions
Johannes Doerfert [Fri, 8 Apr 2016 18:16:02 +0000 (18:16 +0000)]
Collect and verify generated parallel subfunctions

  We verify the optimized function now for a long time and it helped to track
  down bugs early. This will now also happen for all parallel subfunctions we
  generate.

llvm-svn: 265823

8 years agoRevert r265817
Colin LeMahieu [Fri, 8 Apr 2016 18:15:37 +0000 (18:15 +0000)]
Revert r265817

lld tests need to be addressed.

llvm-svn: 265822

8 years agofix missing import of 'time' in lldbutil.wait_for_file_on_target
Todd Fiala [Fri, 8 Apr 2016 18:06:11 +0000 (18:06 +0000)]
fix missing import of 'time' in lldbutil.wait_for_file_on_target

This triggers in some timeout scenarios in the LLDB test suite.

Fixes:
https://bugs.swift.org/browse/SR-1193

llvm-svn: 265821

8 years agoCleanups to command alias to refer to itself as 'command alias' and not allow to...
Enrico Granata [Fri, 8 Apr 2016 17:56:57 +0000 (17:56 +0000)]
Cleanups to command alias to refer to itself as 'command alias' and not allow to make aliases starting with a - as that isn't really supported, and is most often a mistake (trying to pass options)

llvm-svn: 265820

8 years agoAdd help for our regular expression commands when aliased
Enrico Granata [Fri, 8 Apr 2016 17:56:26 +0000 (17:56 +0000)]
Add help for our regular expression commands when aliased

llvm-svn: 265819

8 years agoAppend a missing \n
Enrico Granata [Fri, 8 Apr 2016 17:55:59 +0000 (17:55 +0000)]
Append a missing \n

llvm-svn: 265818

8 years ago[llvm-objdump] Printing hex instead of dec by default
Colin LeMahieu [Fri, 8 Apr 2016 17:55:03 +0000 (17:55 +0000)]
[llvm-objdump] Printing hex instead of dec by default

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

llvm-svn: 265817

8 years agoAlways have clang pass -pie-level and -pic-level values to the code generator.
Wei Mi [Fri, 8 Apr 2016 17:42:32 +0000 (17:42 +0000)]
Always have clang pass -pie-level and -pic-level values to the code generator.

Patch by tmsriram!

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

llvm-svn: 265816

8 years ago[Object] Report an error if .alt_entry is used with ELF or COFF.
Lang Hames [Fri, 8 Apr 2016 17:38:51 +0000 (17:38 +0000)]
[Object] Report an error if .alt_entry is used with ELF or COFF.

I'm looking into a better way to do this long-term, but for now at least don't
crash.

llvm-svn: 265815

8 years ago[SystemZ] Support conditional sibling calls via BRCL
Ulrich Weigand [Fri, 8 Apr 2016 17:22:19 +0000 (17:22 +0000)]
[SystemZ] Support conditional sibling calls via BRCL

This adds a conditional variant of CallJG instruction, CallBRCL.
It can be used for conditional sibling calls. Unfortunately, due
to IfCvt limitations, it only really works well for functions without
arguments.

Author: koriakin
Differential Revision: http://reviews.llvm.org/D18864

llvm-svn: 265814

8 years ago[Release Notes] Sort checks alphabetically.
Eugene Zelenko [Fri, 8 Apr 2016 17:21:27 +0000 (17:21 +0000)]
[Release Notes] Sort checks alphabetically.

llvm-svn: 265813

8 years ago[RegBankSelect] Use reverse post order traversal.
Quentin Colombet [Fri, 8 Apr 2016 17:19:10 +0000 (17:19 +0000)]
[RegBankSelect] Use reverse post order traversal.

When assigning the register banks of an instruction, it is best to know
all the constraints of the input to have a good idea of how this will
impact the cost of the whole function.

llvm-svn: 265812

8 years ago[AArch64] Add a test case for the default mapping of RegBankSelect.
Quentin Colombet [Fri, 8 Apr 2016 17:11:51 +0000 (17:11 +0000)]
[AArch64] Add a test case for the default mapping of RegBankSelect.

llvm-svn: 265811

8 years ago[RegisterBankInfo] Change the implementation for the default mapping.
Quentin Colombet [Fri, 8 Apr 2016 16:59:50 +0000 (16:59 +0000)]
[RegisterBankInfo] Change the implementation for the default mapping.

Do not give that much importance to the current register bank of an
operand. This is likely just a side effect of the current execution and
it is properly wise to prefer a register bank that can be extracted from
the information available statically (like encoding constraints and
type).

llvm-svn: 265810

8 years agoAdd testcase from PR27218. NFC.
Michael Kruse [Fri, 8 Apr 2016 16:54:53 +0000 (16:54 +0000)]
Add testcase from PR27218. NFC.

The the bug has already been fixed r265795, but this second testcase
still useful.

llvm-svn: 265809

8 years agoRemove bad indentation introduced in 263859
Luke Drummond [Fri, 8 Apr 2016 16:52:40 +0000 (16:52 +0000)]
Remove bad indentation introduced in 263859

This commit touches whitespace only.
This commit was the original intention of the botched 265797

llvm-svn: 265808

8 years agoMove EABIVersion from CodeGenOptions to TargetOptions
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:05 +0000 (16:52 +0000)]
Move EABIVersion from CodeGenOptions to TargetOptions

It is possible to argue that the EABIVersion field is similar in spirit to the
ABI field in TargetOptions.  It represents the embedded ABI that the target
follows.  This will allow us to thread this information into the target
information construction.

llvm-svn: 265807

8 years agorevert SVN r265702, r265640
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:00 +0000 (16:52 +0000)]
revert SVN r265702, r265640

Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

llvm-svn: 265806

8 years ago[InstCombine] Fix miscompile in FoldSPFofSPF
David Majnemer [Fri, 8 Apr 2016 16:51:49 +0000 (16:51 +0000)]
[InstCombine] Fix miscompile in FoldSPFofSPF

We had a select of a cast of a select but attempted to replace the outer
select with the inner select dispite their incompatible types.

Patch by Anton Korobeynikov!

This fixes PR27236.

llvm-svn: 265805

8 years ago[RegBankSelect] Improve debug output.
Quentin Colombet [Fri, 8 Apr 2016 16:48:16 +0000 (16:48 +0000)]
[RegBankSelect] Improve debug output.

Add verbose information when checking if the current and the desired
register banks match.
Detail what happens when we assign a register bank.

llvm-svn: 265804

8 years agoFix missing include on OpenBSD
Mehdi Amini [Fri, 8 Apr 2016 16:45:05 +0000 (16:45 +0000)]
Fix missing include on OpenBSD

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265803

8 years ago[MIR] Teach the parser how to deal with register banks.
Quentin Colombet [Fri, 8 Apr 2016 16:40:43 +0000 (16:40 +0000)]
[MIR] Teach the parser how to deal with register banks.

llvm-svn: 265802

8 years ago[InstCombine] Add a peephole for redundant assumes
David Majnemer [Fri, 8 Apr 2016 16:37:12 +0000 (16:37 +0000)]
[InstCombine] Add a peephole for redundant assumes

Two or more identical assumes are occasionally next to each other in a
basic block.
While our generic machinery will turn a redundant assume into a no-op,
it is not super cheap.
We can perform a simpler check to achieve the same result for this case.

llvm-svn: 265801

8 years ago[LoopVectorize] Register cloned assumptions
David Majnemer [Fri, 8 Apr 2016 16:37:10 +0000 (16:37 +0000)]
[LoopVectorize] Register cloned assumptions

InstCombine cannot effectively remove redundant assumptions without them
registered in the assumption cache.  The vectorizer can create identical
assumptions but doesn't register them with the cache, resulting in
slower compile times because InstCombine tries to reason about a lot
more assumptions.

Fix this by registering the cloned assumptions.

llvm-svn: 265800

8 years agoRevert bad commit 265797.
Luke Drummond [Fri, 8 Apr 2016 16:35:58 +0000 (16:35 +0000)]
Revert bad commit 265797.

llvm-svn: 265799