platform/upstream/llvm.git
7 years ago[AMDGPU] Tidy up computeKnownBitsForTargetNode/ComputeNumSignBitsForTargetNode argume...
Simon Pilgrim [Wed, 29 Mar 2017 12:09:25 +0000 (12:09 +0000)]
[AMDGPU] Tidy up computeKnownBitsForTargetNode/ComputeNumSignBitsForTargetNode arguments. NFCI.

Based on comment in D31249.

llvm-svn: 298991

7 years ago[X86][MMX] Added generic sitofp test to compare against existing cvtdq2ps test.
Simon Pilgrim [Wed, 29 Mar 2017 10:47:18 +0000 (10:47 +0000)]
[X86][MMX] Added generic sitofp test to compare against existing cvtdq2ps test.

llvm-svn: 298989

7 years ago[X86] Removed old comment. NFCI.
Simon Pilgrim [Wed, 29 Mar 2017 10:44:51 +0000 (10:44 +0000)]
[X86] Removed old comment. NFCI.

No longer makes sense as the previous opcode mnemonic it was referring to is long gone.

llvm-svn: 298988

7 years ago[MachineVerifier] Avoid reference to nullptr
Sven van Haastregt [Wed, 29 Mar 2017 09:08:25 +0000 (09:08 +0000)]
[MachineVerifier] Avoid reference to nullptr

Instantiation of the MachineVerifierPass through
PassInfo::getNormalCtor would yield a segfault since the default
constructor of the MachineVerifierPass takes a reference to nullptr.

Patch by Simone Pellegrini.

Differential Revision: https://reviews.llvm.org/D31387

llvm-svn: 298987

7 years agoMove the x86 cpu feature rtm from Haswell to Skylake matching clang commit r298956.
Eric Christopher [Wed, 29 Mar 2017 07:40:44 +0000 (07:40 +0000)]
Move the x86 cpu feature rtm from Haswell to Skylake matching clang commit r298956.

llvm-svn: 298986

7 years ago[AVX-512] Remove explicit KMOVWrk from isel patterns. COPY_TO_REGCLASS to GR32 is...
Craig Topper [Wed, 29 Mar 2017 07:31:56 +0000 (07:31 +0000)]
[AVX-512] Remove explicit KMOVWrk from isel patterns. COPY_TO_REGCLASS to GR32 is enough.

llvm-svn: 298985

7 years ago[AVX-512] Remove explicit KMOVWrk/KMOVWKr instructions from patterns where we can...
Craig Topper [Wed, 29 Mar 2017 06:55:28 +0000 (06:55 +0000)]
[AVX-512] Remove explicit KMOVWrk/KMOVWKr instructions from patterns where we can just use COPY_TO_REGCLASS instead.

This will result in a KMOVW or KMOVD being emitted during register allocation. And in at least some cases this might allow the register coalescer to remove the copy all together.

llvm-svn: 298984

7 years ago[XRay] Update FDR log reader to be aware of buffer sizes per thread.
Dean Michael Berris [Wed, 29 Mar 2017 06:10:12 +0000 (06:10 +0000)]
[XRay] Update FDR log reader to be aware of buffer sizes per thread.

Summary:
It is problematic for this reader that it expects to read data from
several threads, but the header or message format does not define
framing. Since the buffers are reused, we can't rely on skipping
zeroed out data as a synchronization method either.

There is an argument that this is not version compatible with the format
the reader expected previously. I argue that since the writer wrote garbage
past the end of buffer record, there is no currently working reader to
compromise.

The corresponding writer change is posted to D31384.

Reviewers: dberris, pelikan

Reviewed By: dberris

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31385

llvm-svn: 298983

7 years ago[XRay] [compiler-rt] Write buffer length to FDR log before writing buffer.
Dean Michael Berris [Wed, 29 Mar 2017 05:56:37 +0000 (05:56 +0000)]
[XRay] [compiler-rt] Write buffer length to FDR log before writing buffer.

Summary:
Currently the FDR log writer, upon flushing, dumps a sequence of buffers from
its freelist to disk. A reader can read the first buffer up to an EOB record,
but then it is unclear how far ahead to scan to find the next threads traces.

There are a few ways to handle this problem.
1. The reader has externalized knowledge of the buffer size.
2. The size of buffers is in the file header or otherwise encoded in the log.
3. Only write out the portion of the buffer with records. When released, the
   buffers are marked with a size.
4. The reader looks for memory that matches a pattern and synchronizes on it.

2 and 3 seem the most flexible and 2 does not rule 3 out.

This is an implementation of 2.

In addition, the function handler for fdr more aggressively checks for
finalization and makes an attempt to release its buffer.

Reviewers: pelikan, dberris

Reviewed By: dberris

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31384

llvm-svn: 298982

7 years agoReverted r298976 [OpenCL] Added parsing for OpenCL vector types.
Egor Churaev [Wed, 29 Mar 2017 05:40:45 +0000 (05:40 +0000)]
Reverted r298976 [OpenCL] Added parsing for OpenCL vector types.

llvm-svn: 298978

7 years ago[XRay][compiler-rt] Add an end-to-end test for FDR Logging
Dean Michael Berris [Wed, 29 Mar 2017 05:19:24 +0000 (05:19 +0000)]
[XRay][compiler-rt] Add an end-to-end test for FDR Logging

Summary:
This change exercises the end-to-end functionality defined in the FDR
logging implementation. We also prepare for being able to run traces
generated by the FDR logging implementation from being analysed with the
llvm-xray command that comes with the LLVM distribution.

This also unblocks D31385, D31384, and D31345.

Reviewers: kpw, pelikan

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D31452

llvm-svn: 298977

7 years ago[OpenCL] Added parsing for OpenCL vector types.
Egor Churaev [Wed, 29 Mar 2017 05:08:18 +0000 (05:08 +0000)]
[OpenCL] Added parsing for OpenCL vector types.

Reviewers: cfe-commits, Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, bader

Differential Revision: https://reviews.llvm.org/D31183

llvm-svn: 298976

7 years ago[XRay][tools] Handle "no subcommand" case for llvm-xray
Dean Michael Berris [Wed, 29 Mar 2017 04:55:45 +0000 (04:55 +0000)]
[XRay][tools] Handle "no subcommand" case for llvm-xray

Summary:
Currently the llvm-xray commandline tool fails to handle the case for
when no subcommand is provided in a graceful manner. This fixes that to
print the help message explaining the subcommands and the available
options.

Reviewers: pcc, pelikan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31409

llvm-svn: 298975

7 years ago[Builtin] Unxfail tests for armhf
Weiming Zhao [Wed, 29 Mar 2017 03:36:46 +0000 (03:36 +0000)]
[Builtin] Unxfail tests for armhf

Summary:
Originally, a few tests fail for armhf target due to:
1) COMPILER_RT_ARMHF_TARGET was not set when building the lib
2) COMPILER_RT_ABI should not be defined as `__attribute__((pcs("aapcs")))` for armhf when building for both lib and tests

This address https://bugs.llvm.org//show_bug.cgi?id=32261

mulsc3_test.c is a newly exposed issue, which will be addressed separately.

Reviewers: rengolin, compnerd

Reviewed By: compnerd

Subscribers: aemerson, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D31448

llvm-svn: 298974

7 years agoAttempt to fix buildbot.
Rui Ueyama [Wed, 29 Mar 2017 01:36:37 +0000 (01:36 +0000)]
Attempt to fix buildbot.

llvm-svn: 298971

7 years agoRemove dead include <sys/user.h> from the NetBSD code.
Kamil Rytarowski [Wed, 29 Mar 2017 01:10:21 +0000 (01:10 +0000)]
Remove dead include <sys/user.h> from the NetBSD code.

llvm-svn: 298970

7 years agoUse uint64_t instead of uintX_t and size_t.
Rui Ueyama [Wed, 29 Mar 2017 00:49:50 +0000 (00:49 +0000)]
Use uint64_t instead of uintX_t and size_t.

uint64_t is simpler and less error-prone than target or host-dependent types.

llvm-svn: 298969

7 years agoChange the order of parameters. NFC.
Rui Ueyama [Wed, 29 Mar 2017 00:49:29 +0000 (00:49 +0000)]
Change the order of parameters. NFC.

If a function takes a size and an alignment, we usually pass them
in that order instead of the reverse order.

llvm-svn: 298968

7 years agoRevert "Added `applyAtomicChanges` function."
Juergen Ributzka [Wed, 29 Mar 2017 00:24:36 +0000 (00:24 +0000)]
Revert "Added `applyAtomicChanges` function."

This broke GreenDragon:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-modulesRDA_build/4776/

Reverting this commit and all follow-up commits.

llvm-svn: 298967

7 years agoRevert "Try to unbreak buildbots after r298913."
Juergen Ributzka [Wed, 29 Mar 2017 00:24:34 +0000 (00:24 +0000)]
Revert "Try to unbreak buildbots after r298913."

llvm-svn: 298966

7 years agoRevert "clangToolingRefactor: Add libdeps upon clangFormat in r298913."
Juergen Ributzka [Wed, 29 Mar 2017 00:24:32 +0000 (00:24 +0000)]
Revert "clangToolingRefactor: Add libdeps upon clangFormat in r298913."

llvm-svn: 298965

7 years agoRemove a comment that is taken from gdb man page.
Rui Ueyama [Wed, 29 Mar 2017 00:09:40 +0000 (00:09 +0000)]
Remove a comment that is taken from gdb man page.

This is not an original comment but taken from gdb man page, so
a pointer to the original document should suffice.

llvm-svn: 298964

7 years ago[SDAG] Remove -enable-fmf-dag
Adam Nemet [Tue, 28 Mar 2017 23:46:14 +0000 (23:46 +0000)]
[SDAG] Remove -enable-fmf-dag

This is no longer needed as spotted by Sanjay in
https://reviews.llvm.org/D31165.

llvm-svn: 298963

7 years ago[SDAG] Handle VectorReduction in SDNodeFlags::intersectWith
Adam Nemet [Tue, 28 Mar 2017 23:46:12 +0000 (23:46 +0000)]
[SDAG] Handle VectorReduction in SDNodeFlags::intersectWith

Spotted by Sanjay in https://reviews.llvm.org/D31165

llvm-svn: 298962

7 years ago[SDAG] Add AllowContract to SNodeFlags
Adam Nemet [Tue, 28 Mar 2017 23:46:08 +0000 (23:46 +0000)]
[SDAG] Add AllowContract to SNodeFlags

Properly propagate the FMF from the LLVM IR to this flag.

This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.

Differential Revision: https://reviews.llvm.org/D31165

llvm-svn: 298961

7 years agoMore accurate header inclusions. NFC.
Peter Collingbourne [Tue, 28 Mar 2017 23:35:34 +0000 (23:35 +0000)]
More accurate header inclusions. NFC.

llvm-svn: 298960

7 years ago[AVX-512] Add test case that was supposed to go with r298957.
Craig Topper [Tue, 28 Mar 2017 23:29:35 +0000 (23:29 +0000)]
[AVX-512] Add test case that was supposed to go with r298957.

llvm-svn: 298959

7 years agoPrint the error if dsymForUUID sometimes produces bad plists.
Jim Ingham [Tue, 28 Mar 2017 23:25:34 +0000 (23:25 +0000)]
Print the error if dsymForUUID sometimes produces bad plists.

Not much we can do about it but at least we can print the bad
plist and the error.

llvm-svn: 298958

7 years ago[AVX-512] Punt on fast-isel of truncates to i1 when AVX512 is enabled.
Craig Topper [Tue, 28 Mar 2017 23:20:37 +0000 (23:20 +0000)]
[AVX-512] Punt on fast-isel of truncates to i1 when AVX512 is enabled.

We should be masking the value and emitting a register copy like we do in non-fast isel. Instead we were just updating the value map and emitting nothing.

After r298928 we started seeing cases where we would create a copy from GR8 to GR32 because the source register in a VK1 to GR32 copy was replaced by the GR8 going into a truncate.

This fixes PR32451.

llvm-svn: 298957

7 years agoDefault enable the rtm feature only on skylake and later for now because Intel disabl...
Eric Christopher [Tue, 28 Mar 2017 23:03:19 +0000 (23:03 +0000)]
Default enable the rtm feature only on skylake and later for now because Intel disabled the feature on some haswell and broadwell processors:

http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf

the -mrtm option will still work normally.

llvm-svn: 298956

7 years ago[PPC] In PPCBoolRetToInt change the bool value to i64 if the target is ppc64
Guozhi Wei [Tue, 28 Mar 2017 22:55:01 +0000 (22:55 +0000)]
[PPC] In PPCBoolRetToInt change the bool value to i64 if the target is ppc64

In PPCBoolRetToInt bool value is changed to i32 type. On ppc64 it may introduce an extra zero extension for the return value. This patch changes the integer type to i64 to avoid the zero extension on ppc64.

This patch fixed PR32442.

Differential Revision: https://reviews.llvm.org/D31407

llvm-svn: 298955

7 years ago[DAGCombiner] reduce code duplication with local variables; NFCI
Sanjay Patel [Tue, 28 Mar 2017 22:45:53 +0000 (22:45 +0000)]
[DAGCombiner] reduce code duplication with local variables; NFCI

llvm-svn: 298954

7 years agoAdd support for tracing hello-world application on NetBSD
Kamil Rytarowski [Tue, 28 Mar 2017 22:43:17 +0000 (22:43 +0000)]
Add support for tracing hello-world application on NetBSD

Summary:
This patch is a stripped down from features a NetBSD process
code (patch is kept under 2k LOC). This code has assumption that
there is only one thread within a debugged process. The only
debugger trap supported is software breakpoint (TRAP_BRKPT).
The generic platform code requires to add dummy function for
watchpoints etc. These functions are currently empty.
This code is not the final platform support as is and it's treated as
a base to extend, refactor and address issues afterwards.

Supported features:
 - handle software breakpoints,
 - correctly attach to a tracee,
 - support NetBSD specific ptrace(2),
 - monitor process termination,
 - monitor SIGTRAP events,
 - monitor SIGSTOP events,
 - monitor other signals events,
 - resume the whole process,
 - get memory region info perms,
 - read memory from tracee,
 - write memory to tracee,
 - read ELF AUXV,
 - x86_64 GPR read and write code

For the generic framework include:
 - halt,
 - detach,
 - signal,
 - kill,
 - allocatememory,
 - deallocatememory,
 - update threads,
 - getarchitecture,
 - getfileloadaddress,
 - and others.

This code has preliminary AddThread code.

Out of interest in this patch:
 - exec() traps,
 - hardware debug register traps,
 - single step trap,
 - thread creation/termination trap,
 - process fork(2), vfork(2) and vfork(2) done traps,
 - syscall entry and exit trap,
 - threads,
 - FPR registers,
 - retrieving tracee's thread name,
 - non x86_64 support.

This code can be used to start a hello world application and trace it.

This code can be used by other BSD systems as a starting point to get similar
capabilities.

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, joerg, kettenis, labath

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31374

llvm-svn: 298953

7 years agoAdd a similar test for tailcall optimization as in r270287 for aarch64.
Eric Christopher [Tue, 28 Mar 2017 22:37:43 +0000 (22:37 +0000)]
Add a similar test for tailcall optimization as in r270287 for aarch64.

llvm-svn: 298952

7 years agoLTO: Replace InputFile::Symbol::getFlags() with predicate accessors. NFC.
Peter Collingbourne [Tue, 28 Mar 2017 22:31:35 +0000 (22:31 +0000)]
LTO: Replace InputFile::Symbol::getFlags() with predicate accessors. NFC.

This makes the predicates independent of the flag representation
and makes the code a little easier to read.

llvm-svn: 298951

7 years ago[DAG] fix formatting; NFC
Sanjay Patel [Tue, 28 Mar 2017 22:25:25 +0000 (22:25 +0000)]
[DAG] fix formatting; NFC

llvm-svn: 298950

7 years ago[DAGCombiner] remove redundant conditions and duplicated code; NFCI
Sanjay Patel [Tue, 28 Mar 2017 22:22:50 +0000 (22:22 +0000)]
[DAGCombiner] remove redundant conditions and duplicated code; NFCI

llvm-svn: 298949

7 years ago[AMDGPU] Boost unroll threshold for loops reading local memory
Stanislav Mekhanoshin [Tue, 28 Mar 2017 22:13:51 +0000 (22:13 +0000)]
[AMDGPU] Boost unroll threshold for loops reading local memory

This is less important than increase threshold for private memory,
but still brings performance improvements in a wide range of tests.
Unrolling more for local memory serves three purposes: it allows
to combine ds operations if offset becomes static, saves registers
used for offsets in case of static offsets, and allows better lds
latency hiding.

Differential Revision: https://reviews.llvm.org/D31412

llvm-svn: 298948

7 years agoPostpone lsan tls allocation until required
Francis Ricci [Tue, 28 Mar 2017 21:56:45 +0000 (21:56 +0000)]
Postpone lsan tls allocation until required

Summary:
This prevents InternalAlloc from being called before the sanitizers
are fully initialized.

Reviewers: kubamracek, kcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31306

llvm-svn: 298947

7 years agoEnable i386 builds for darwin lsan
Francis Ricci [Tue, 28 Mar 2017 21:56:44 +0000 (21:56 +0000)]
Enable i386 builds for darwin lsan

Summary:
Now that __thread is no longer used for lsan on darwin, i386 builds
can be enabled.

Reviewers: kcc, kubamracek

Subscribers: danalbert, srhines, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29995

llvm-svn: 298946

7 years ago[AMDGPU] Fix recorded region boundaries in max-occupancy scheduler
Stanislav Mekhanoshin [Tue, 28 Mar 2017 21:48:54 +0000 (21:48 +0000)]
[AMDGPU] Fix recorded region boundaries in max-occupancy scheduler

This is incorrect to record region boundaries before scheduling,
it may change after scheduling. As a result second pass may see less
instructions to schedule than it should.

Differential Revision: https://reviews.llvm.org/D31434

llvm-svn: 298945

7 years ago[DAGCombiner] rename variables in foldAndOfSetCCs for easier reading; NFCI
Sanjay Patel [Tue, 28 Mar 2017 21:40:41 +0000 (21:40 +0000)]
[DAGCombiner] rename variables in foldAndOfSetCCs for easier reading; NFCI

llvm-svn: 298944

7 years ago[X86][MMX] Match MMX fp_to_sint conversions from XMM registers
Simon Pilgrim [Tue, 28 Mar 2017 21:32:11 +0000 (21:32 +0000)]
[X86][MMX] Match MMX fp_to_sint conversions from XMM registers

We currently perform the various fp_to_sint XMM conversion and then transfer to the MMX register (on 32-bit via the stack).

This patch improves support for MOVDQ2Q XMM to MMX transfers and adds the XMM->MMX fp_to_sint direct conversion patterns. The SSE2 specifications are the same as for XMM->XMM and XMM->MMX rounding/exceptions/etc.

Differential Revision: https://reviews.llvm.org/D30868

llvm-svn: 298943

7 years agoCOFF: include archive name in LTO object name
Bob Haarman [Tue, 28 Mar 2017 21:20:06 +0000 (21:20 +0000)]
COFF: include archive name in LTO object name

Summary: In the ELF linker, we create the buffer identifier for bitcode files by appending the object name to the archive name. This change makes the COFF linker do the same. Without the change, ThinLTO builds can fail with an error message about multiple ThinLTO modules per object file, caused by object files contained in different archives having the same name.

Reviewers: pcc, ruiu

Reviewed By: pcc

Subscribers: mehdi_amini

Differential Revision: https://reviews.llvm.org/D31402

llvm-svn: 298942

7 years agoFix crashing on TargetCustom PseudoSourceValues
Matt Arsenault [Tue, 28 Mar 2017 20:33:12 +0000 (20:33 +0000)]
Fix crashing on TargetCustom PseudoSourceValues

Default to something more reasonable if printCustom isn't implemented.

llvm-svn: 298941

7 years ago[DAGCombiner] clean up foldAndOfSetCCs; NFCI
Sanjay Patel [Tue, 28 Mar 2017 20:28:16 +0000 (20:28 +0000)]
[DAGCombiner] clean up foldAndOfSetCCs; NFCI

1. Fix bogus comment.
2. Early exit to reduce indent.
3. Change node pointer param to what it really is: an SDLoc.

llvm-svn: 298940

7 years ago[IR] Add AllowContract to FastMathFlags
Adam Nemet [Tue, 28 Mar 2017 20:11:52 +0000 (20:11 +0000)]
[IR] Add AllowContract to FastMathFlags

-ffp-contract=fast does not currently work with LTO because it's passed as a
TargetOption to the backend rather than in the IR. This adds it to
FastMathFlags.

This is toward fixing PR25721

Differential Revision: https://reviews.llvm.org/D31164

llvm-svn: 298939

7 years ago[DAGCombiner] add helper function for and-of-setcc folds; NFC
Sanjay Patel [Tue, 28 Mar 2017 19:58:46 +0000 (19:58 +0000)]
[DAGCombiner] add helper function for and-of-setcc folds; NFC

This is just a cut and paste followed by clang-format. Clean up to follow.

llvm-svn: 298938

7 years ago[libc++] Add a key function for bad_function_call
Shoaib Meenai [Tue, 28 Mar 2017 19:33:31 +0000 (19:33 +0000)]
[libc++] Add a key function for bad_function_call

Summary:
bad_function_call is currently an empty class, so any object files using
that class will end up with their own copy of its typeinfo, typeinfo
name and vtable, leading to unnecessary duplication that has to be
resolved by the dynamic linker. Instead, give bad_function_call a key
function and put a definition for that key function in libc++ itself, to
centralize the typeinfo and vtable.

This is consistent with the behavior for other exception classes. The
key functions are defined in libc++ rather than libc++abi since the
class is defined in the libc++ versioning namespace, so ABI
compatibility with libstdc++ is not a concern.

Guard this change behind an ABI macro, since it isn't backwards
compatible (i.e., clients built against the new libc++ headers wouldn't
be able to run against an older libc++ library).

Reviewers: mclow.lists, EricWF

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D27387

llvm-svn: 298937

7 years agoAdd support for -fno-builtin to LTO and ThinLTO to libLTO
Mehdi Amini [Tue, 28 Mar 2017 18:55:44 +0000 (18:55 +0000)]
Add support for -fno-builtin to LTO and ThinLTO to libLTO

Reviewers: tejohnson, pcc

Subscribers: Prazek, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D30791

llvm-svn: 298936

7 years ago[AMDGPU] Split -amdgpu-early-inline-all option
Stanislav Mekhanoshin [Tue, 28 Mar 2017 18:23:24 +0000 (18:23 +0000)]
[AMDGPU] Split -amdgpu-early-inline-all option

Previously it was covered by the internalization. It turns out we cannot
run internalizer in FE, it break separate compilation tests. Thus early
inliner gets its own option.

Differential Revision: https://reviews.llvm.org/D31429

llvm-svn: 298935

7 years agoDo not set entsize for .gnu.hash.
Rui Ueyama [Tue, 28 Mar 2017 18:11:52 +0000 (18:11 +0000)]
Do not set entsize for .gnu.hash.

.gnu.hash happen to contain only 32-bit integers for 32-bit arch,
but the section contents are not uniform array members, so setting
entsize doesn't make much sense. This behavior seems to have been
blindly copied from GNU linkers.

llvm-svn: 298934

7 years ago[x86] use VPMOVMSK to replace memcmp libcalls for 32-byte equality
Sanjay Patel [Tue, 28 Mar 2017 17:23:49 +0000 (17:23 +0000)]
[x86] use VPMOVMSK to replace memcmp libcalls for 32-byte equality

Follow-up to:
https://reviews.llvm.org/rL298775

llvm-svn: 298933

7 years agoRevert "Dont emit Mapping symbols for sections that contain only data."
Weiming Zhao [Tue, 28 Mar 2017 17:15:11 +0000 (17:15 +0000)]
Revert "Dont emit Mapping symbols for sections that contain only data."

It breaks some lld tests.

This reverts commit 3a50eea6d9732ab40e9a7aebe6be777b53a8b35c.

llvm-svn: 298932

7 years ago[SDAG] Deal with deleted node in PromoteIntShiftOp
Nirav Dave [Tue, 28 Mar 2017 17:09:49 +0000 (17:09 +0000)]
[SDAG] Deal with deleted node in PromoteIntShiftOp

Deal with case that initial node is deleted during dag-combine leading
to an assertional failure in promoteIntShiftOp.

Fixes PR32420.

Reviewers: spatel, RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31403

llvm-svn: 298931

7 years agoAdd reproducer test for pr32449. NFC.
Zvi Rackover [Tue, 28 Mar 2017 16:45:23 +0000 (16:45 +0000)]
Add reproducer test for pr32449. NFC.

llvm-svn: 298930

7 years ago[X86][AVX2] Add support for combining v16i16 shuffles to VPBLENDW
Simon Pilgrim [Tue, 28 Mar 2017 16:40:38 +0000 (16:40 +0000)]
[X86][AVX2] Add support for combining v16i16 shuffles to VPBLENDW

llvm-svn: 298929

7 years ago[AVX-512] Fix accidental uses of AH/BH/CH/DH after copies to/from mask registers
Craig Topper [Tue, 28 Mar 2017 16:35:29 +0000 (16:35 +0000)]
[AVX-512] Fix accidental uses of AH/BH/CH/DH after copies to/from mask registers

We've had several bugs(PR32256, PR32241) recently that resulted from usages of AH/BH/CH/DH either before or after a copy to/from a mask register.

This ultimately occurs because we create COPY_TO_REGCLASS with VK1 and GR8. Then in CopyToFromAsymmetricReg in X86InstrInfo we find a 32-bit super register for the GR8 to emit the KMOV with. But as these tests are demonstrating, its possible for the GR8 register to be a high register and we end up doing an accidental extra or insert from bits 15:8.

I think the best way forward is to stop making copies directly between mask registers and GR8/GR16. Instead I think we should restrict to only copies between mask registers and GR32/GR64 and use EXTRACT_SUBREG/INSERT_SUBREG to handle the conversion from GR32 to GR16/8 or vice versa.

Unfortunately, this complicates fastisel a bit more now to create the subreg extracts where we used to create GR8 copies. We can probably make a helper function to bring down the repitition.

This does result in KMOVD being used for copies when BWI is available because we don't know the original mask register size. This caused a lot of deltas on tests because we have to split the checks for KMOVD vs KMOVW based on BWI.

Differential Revision: https://reviews.llvm.org/D30968

llvm-svn: 298928

7 years ago[analyzer] Fix symbolication for unknown unary increment/decrement results.
Artem Dergachev [Tue, 28 Mar 2017 15:57:12 +0000 (15:57 +0000)]
[analyzer] Fix symbolication for unknown unary increment/decrement results.

If the value is known, but we cannot increment it, conjure a symbol to
represent the result of the operation based on the operator expression,
not on the sub-expression.

In particular, no longer crash on comparing a result of a LocAsInteger increment
to a constant integer.

rdar://problem/31067356

Differential Revision: https://reviews.llvm.org/D31289

llvm-svn: 298927

7 years ago[x86] add separate check prefix for SSE; NFC
Sanjay Patel [Tue, 28 Mar 2017 15:55:50 +0000 (15:55 +0000)]
[x86] add separate check prefix for SSE; NFC

We want to check each test on each target, so we need another prefix
when SSE and AVX diverge (as they will if we handle 32-byte and higher).

llvm-svn: 298926

7 years ago[X86][SSE] Refactored shuffle BLEND combining to make future 16i16 support easier...
Simon Pilgrim [Tue, 28 Mar 2017 15:50:23 +0000 (15:50 +0000)]
[X86][SSE] Refactored shuffle BLEND combining to make future 16i16 support easier. NFCI.

Call the matchVectorShuffleAsBlend test as early as possible.

llvm-svn: 298925

7 years ago[analyzer] When creating a temporary object, properly copy the value into it.
Artem Dergachev [Tue, 28 Mar 2017 15:43:26 +0000 (15:43 +0000)]
[analyzer] When creating a temporary object, properly copy the value into it.

Adjustments should be considered properly; we should copy the unadjusted object
over the whole temporary base region. If the unadjusted object is no longer
available in the Environment, invalidate the temporary base region, and then
copy the adjusted object into the adjusted sub-region of the temporary region.

This fixes a regression introduced by r288263, that caused various
false positives, due to copying only adjusted object into the adjusted region;
the rest of the base region therefore remained undefined.
Before r288263, the adjusted value was copied over the unadjusted region,
which is incorrect, but accidentally worked better due to how region store
disregards compound value bindings to non-base regions.

An additional test machinery is introduced to make sure that despite making
two binds, we only notify checkers once for both of them, without exposing
the partially copied objects.

This fix is a hack over a hack. The proper fix would be to model C++ temporaries
in the CFG, and after that dealing with adjustments would no longer be
necessary, and the values we need would no longer disappear from the
Environment.

rdar://problem/30658168

Differential Revision: https://reviews.llvm.org/D30534

llvm-svn: 298924

7 years ago[SDAG] Avoid deleted SDNodes PromoteIntBinOp
Nirav Dave [Tue, 28 Mar 2017 15:41:12 +0000 (15:41 +0000)]
[SDAG] Avoid deleted SDNodes PromoteIntBinOp

Reorder work in PromoteIntBinOp to prevent stale (deleted) nodes from
being used.

Fixes PR32340 and PR32345.

Reviewers: hfinkel, dbabokin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31148

llvm-svn: 298923

7 years ago[libunwind] Add sphinx docs
Jonathan Roelofs [Tue, 28 Mar 2017 15:21:43 +0000 (15:21 +0000)]
[libunwind] Add sphinx docs

https://reviews.llvm.org/D31375

llvm-svn: 298922

7 years agoclangToolingRefactor: Add libdeps upon clangFormat in r298913.
NAKAMURA Takumi [Tue, 28 Mar 2017 14:18:10 +0000 (14:18 +0000)]
clangToolingRefactor: Add libdeps upon clangFormat in r298913.

llvm-svn: 298921

7 years ago[SDAG] Fix Stale SDNode usage in visitAND
Nirav Dave [Tue, 28 Mar 2017 14:11:20 +0000 (14:11 +0000)]
[SDAG] Fix Stale SDNode usage in visitAND

Reorder CombineTo Calls to prevent potential use of deleted node.
Fixes PR32372.

Reviewers: jnspaulsson, RKSimon, uweigand, jonpa

Reviewed By: jonpa

Subscribers: jonpa, llvm-commits

Differential Revision: https://reviews.llvm.org/D31346

llvm-svn: 298920

7 years agoTry to unbreak buildbots after r298913.
Eric Liu [Tue, 28 Mar 2017 13:56:19 +0000 (13:56 +0000)]
Try to unbreak buildbots after r298913.

llvm-svn: 298919

7 years ago[x86] add AVX2 run to show 256-bit opportunity; NFC
Sanjay Patel [Tue, 28 Mar 2017 13:46:50 +0000 (13:46 +0000)]
[x86] add AVX2 run to show 256-bit opportunity; NFC

llvm-svn: 298918

7 years agoFix signed/unsigned comparison warning
Simon Pilgrim [Tue, 28 Mar 2017 13:40:09 +0000 (13:40 +0000)]
Fix signed/unsigned comparison warning

llvm-svn: 298917

7 years ago[SDAG] Minor cleanup of variable usage. NFC.
Nirav Dave [Tue, 28 Mar 2017 13:39:50 +0000 (13:39 +0000)]
[SDAG] Minor cleanup of variable usage. NFC.

llvm-svn: 298916

7 years agoFix for bug https://llvm.org/bugs/show_bug.cgi?id=30889
Andrey Churbanov [Tue, 28 Mar 2017 13:35:42 +0000 (13:35 +0000)]
Fix for bug https://llvm.org/bugs/show_bug.cgi?id=30889
Condition adjusted for Debug assertion.

Differential Revision: https://reviews.llvm.org/D29638

llvm-svn: 298915

7 years ago[X86][SSE] Begin merging vector shuffle to BLEND for lowering and combining.
Simon Pilgrim [Tue, 28 Mar 2017 13:05:48 +0000 (13:05 +0000)]
[X86][SSE] Begin merging vector shuffle to BLEND for lowering and combining.

Split off matchVectorShuffleAsBlend from lowerVectorShuffleAsBlend for reuse in combining.

llvm-svn: 298914

7 years agoAdded `applyAtomicChanges` function.
Eric Liu [Tue, 28 Mar 2017 13:05:32 +0000 (13:05 +0000)]
Added `applyAtomicChanges` function.

Summary: ... which applies a set of `AtomicChange`s on code.

Reviewers: klimek, djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D30777

llvm-svn: 298913

7 years ago[ASTMatchers] add typeAliasTemplateDecl matcher.
Eric Liu [Tue, 28 Mar 2017 12:56:47 +0000 (12:56 +0000)]
[ASTMatchers] add typeAliasTemplateDecl matcher.

Reviewers: hokein, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D28671

llvm-svn: 298912

7 years agoWdocumentation fix
Simon Pilgrim [Tue, 28 Mar 2017 12:29:09 +0000 (12:29 +0000)]
Wdocumentation fix

llvm-svn: 298911

7 years ago[X86][SSE] Set second operand to undef instead of first operand in unary shuffle...
Simon Pilgrim [Tue, 28 Mar 2017 12:16:42 +0000 (12:16 +0000)]
[X86][SSE] Set second operand to undef instead of first operand in unary shuffle combines.

Copy isn't necessary after the matchVectorShuffleWithUNPCK refactor and undef value will make some future undef/zero handling easier.

llvm-svn: 298910

7 years agoStrip trailing whitespace
Simon Pilgrim [Tue, 28 Mar 2017 11:15:17 +0000 (11:15 +0000)]
Strip trailing whitespace

llvm-svn: 298909

7 years ago[AArch64] [Assembler] option to disable negative immediate conversions
Sanne Wouda [Tue, 28 Mar 2017 10:02:56 +0000 (10:02 +0000)]
[AArch64] [Assembler] option to disable negative immediate conversions

Summary:
Similar to the ARM target in https://reviews.llvm.org/rL298380, this
patch adds identical infrastructure for disabling negative immediate
conversions, and converts the existing aliases to the new infrastucture.

Reviewers: rengolin, javed.absar, olista01, SjoerdMeijer, samparker

Reviewed By: samparker

Subscribers: samparker, aemerson, llvm-commits

Differential Revision: https://reviews.llvm.org/D31243

llvm-svn: 298908

7 years ago[GlobalISel][X86] support G_FRAME_INDEX instruction selection.
Igor Breger [Tue, 28 Mar 2017 09:35:06 +0000 (09:35 +0000)]
[GlobalISel][X86] support G_FRAME_INDEX instruction selection.

    Summary:
    G_LOAD/G_STORE, add alternative RegisterBank mapping.
    For G_LOAD, Fast and Greedy mode choose the same RegisterBank mapping (GprRegBank ) for the G_GLOAD + G_FADD , can't get rid of cross register bank copy GprRegBank->VecRegBank.

    Reviewers: zvi, rovka, qcolombet, ab

    Reviewed By: zvi

    Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank

    Differential Revision: https://reviews.llvm.org/D30979

llvm-svn: 298907

7 years ago[InstCombine] For select rule, use positive check of constant int for select operand...
Anna Thomas [Tue, 28 Mar 2017 09:32:24 +0000 (09:32 +0000)]
[InstCombine] For select rule, use positive check of constant int for select operand. NFCI

llvm-svn: 298906

7 years agoFileManager: mark virtual file entries as valid entries
Erik Verbruggen [Tue, 28 Mar 2017 09:18:05 +0000 (09:18 +0000)]
FileManager: mark virtual file entries as valid entries

The getVirtualFile method would create entries for e.g. libclang's
CXUnsavedFile but not mark them as valid. The effect is that a lookup
through getFile where the file name is not exactly matching the virtual
file (e.g. through mixing slashes and backslashes on Windows) would
result in a normal file "lookup", and re-using the file entry found
by using the UniqueID, and overwrite the file entry fields. Because the
lookup involves opening the file, and moving it into the file entry, the
file is now open. The SourceManager keys its buffers on the UniqueID
(which is still the same), so it will find an already loaded buffer.
Because only the loading a buffer from disk will close the file, the
FileEntry will hold on to an open file for as long as the FileManager
is around. As the FileManager will only get destroyed at a reparse,
you can't safe to the "leaked" and locked file on Windows.

llvm-svn: 298905

7 years agorename instcombine test file. NFC
Anna Thomas [Tue, 28 Mar 2017 08:34:07 +0000 (08:34 +0000)]
rename instcombine test file. NFC

llvm-svn: 298904

7 years ago[libclang] Fix crash in member access code completion with implicit base
Erik Verbruggen [Tue, 28 Mar 2017 07:22:21 +0000 (07:22 +0000)]
[libclang] Fix crash in member access code completion with implicit base

If there is an unresolved member access AST node, and the base is
implicit, do not access/use it for generating candidate overloads for
code completion results.

Fixes PR31093.

llvm-svn: 298903

7 years ago[AMDGPU] Update SI scheduler colorHighLatenciesGroups
Valery Pykhtin [Tue, 28 Mar 2017 07:19:48 +0000 (07:19 +0000)]
[AMDGPU] Update SI scheduler colorHighLatenciesGroups

Depends on rL298896: MachineScheduler/ScheduleDAG: Add support for GetSubGraph

Patch by Axel Davy (axel.davy@normalesup.org)

Differential revision: https://reviews.llvm.org/D30152

llvm-svn: 298902

7 years agoDont emit Mapping symbols for sections that contain only data.
Weiming Zhao [Tue, 28 Mar 2017 05:40:36 +0000 (05:40 +0000)]
Dont emit Mapping symbols for sections that contain only data.

Summary:
Dont emit mapping symbols for sections that contain only data.

Patched by Shankar Easwaran <shankare@codeaurora.org>

Reviewers: rengolin, peter.smith, weimingz, kparzysz, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, llvm-commits

Differential Revision: https://reviews.llvm.org/D30724

llvm-svn: 298901

7 years ago[APInt] Reformat tc functions to put opening curly braces on the end of the previous...
Craig Topper [Tue, 28 Mar 2017 05:32:55 +0000 (05:32 +0000)]
[APInt] Reformat tc functions to put opening curly braces on the end of the previous line. NFC

llvm-svn: 298900

7 years ago[APInt] Remove an anonymous namespace around static functions. NFC
Craig Topper [Tue, 28 Mar 2017 05:32:53 +0000 (05:32 +0000)]
[APInt] Remove an anonymous namespace around static functions. NFC

llvm-svn: 298899

7 years ago[APInt] Combine variable declaration and initialization where possible in the tc...
Craig Topper [Tue, 28 Mar 2017 05:32:52 +0000 (05:32 +0000)]
[APInt] Combine variable declaration and initialization where possible in the tc functions. NFCI

llvm-svn: 298898

7 years ago[APInt] Use 'unsigned' instead of 'unsigned int' in the interface to the APInt tc...
Craig Topper [Tue, 28 Mar 2017 05:32:48 +0000 (05:32 +0000)]
[APInt] Use 'unsigned' instead of 'unsigned int' in the interface to the APInt tc functions. This is more consistent with the rest of the codebase. NFC

llvm-svn: 298897

7 years agoMachineScheduler/ScheduleDAG: Add support for GetSubGraph
Valery Pykhtin [Tue, 28 Mar 2017 05:12:31 +0000 (05:12 +0000)]
MachineScheduler/ScheduleDAG: Add support for GetSubGraph

Patch by Axel Davy (axel.davy@normalesup.org)

Differential revision: https://reviews.llvm.org/D30626

llvm-svn: 298896

7 years agoCodeGen : Check LLVM_ENABLE_DUMP definition for dumpMachineInstrRangeWithSlotIndex.
Junmo Park [Tue, 28 Mar 2017 04:14:25 +0000 (04:14 +0000)]
CodeGen : Check LLVM_ENABLE_DUMP definition for dumpMachineInstrRangeWithSlotIndex.

Summary:
Add missing check routine for dumpMachineInstrRangeWithSlotIndex including LLVM_DUMP_METHOD.

Reviewers: bkramer

Differential revision: https://reviews.llvm.org/D30367

llvm-svn: 298895

7 years ago[APInt] Move the single word cases of the bitwise operators inline.
Craig Topper [Tue, 28 Mar 2017 04:00:47 +0000 (04:00 +0000)]
[APInt] Move the single word cases of the bitwise operators inline.

llvm-svn: 298894

7 years agoUse BuildReturnStmt in SemaCoroutine to unbreak sanitizer tests.
Gor Nishanov [Tue, 28 Mar 2017 02:51:45 +0000 (02:51 +0000)]
Use BuildReturnStmt in SemaCoroutine to unbreak sanitizer tests.

FIXME: ActOnReturnStmt expects a scope that is inside of the function, due
  to CheckJumpOutOfSEHFinally(*this, ReturnLoc, *CurScope->getFnParent());
  S.getCurScope()->getFnParent() == nullptr at ActOnFinishFunctionBody when
  CoroutineBodyStmt is built. Figure it out and fix it.
llvm-svn: 298893

7 years agoReland "[Compiler-rt][Builtins] Implement lit-test support (part 2 of 2)"
Weiming Zhao [Mon, 27 Mar 2017 23:57:44 +0000 (23:57 +0000)]
Reland "[Compiler-rt][Builtins] Implement lit-test support (part 2 of 2)"

Re-land of r298714 which got reverted in r298868.
It looks like the current lit tests won't run for Apple.
Possible reason is the libname is different. (need to update
the base_lib variable of lit.cfg)

llvm-svn: 298892

7 years ago[coroutines] Handle get_return_object_on_allocation_failure
Gor Nishanov [Mon, 27 Mar 2017 23:36:59 +0000 (23:36 +0000)]
[coroutines] Handle get_return_object_on_allocation_failure

Summary:
If promise_type has get_return_object_on_allocation_failure defined,
check if an allocation function returns nullptr, and if so,
return the result of get_return_object_on_allocation_failure().

Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D31399

llvm-svn: 298891

7 years agoRevert "[asan] Delay creation of asan ctor."
Alex Shlyapnikov [Mon, 27 Mar 2017 23:11:50 +0000 (23:11 +0000)]
Revert "[asan] Delay creation of asan ctor."

Speculative revert. Some libfuzzer tests are affected.

This reverts commit r298731.

llvm-svn: 298890

7 years agoRevert "[asan] Put ctor/dtor in comdat."
Alex Shlyapnikov [Mon, 27 Mar 2017 23:11:47 +0000 (23:11 +0000)]
Revert "[asan] Put ctor/dtor in comdat."

Speculative revert, some libfuzzer tests are affected.

This reverts commit r298756.

llvm-svn: 298889

7 years agoRemove an oddly unnecessary temporary.
Eric Christopher [Mon, 27 Mar 2017 22:40:51 +0000 (22:40 +0000)]
Remove an oddly unnecessary temporary.

llvm-svn: 298888

7 years ago[ARM] Mark falky test unsupported until we find the cause
Renato Golin [Mon, 27 Mar 2017 22:38:43 +0000 (22:38 +0000)]
[ARM] Mark falky test unsupported until we find the cause

llvm-svn: 298887

7 years ago[libfuzzer] Remove XFAIL for OutOfMemory test.
Juergen Ributzka [Mon, 27 Mar 2017 22:33:05 +0000 (22:33 +0000)]
[libfuzzer] Remove XFAIL for OutOfMemory test.

This test is now passing on Darwin.

See rdar://problem/31282257.

llvm-svn: 298886