platform/upstream/llvm.git
6 years ago[llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.
George Rimar [Wed, 18 Jul 2018 08:19:58 +0000 (08:19 +0000)]
[llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.

http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html

says that e_shnum and/or e_shstrndx may have special values if
"the number of sections is greater than or equal to SHN_LORESERVE" or
"the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00)"

Previously llvm-readobj was unable to dump such files, patch changes that.

I had to add a precompiled test case because it does not seem possible to
prepare a test using yaml2obj or llvm-mc (not clear how to make .shstrtab
to have index >= SHN_LORESERVE).

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

llvm-svn: 337360

6 years agoRevert test changes part of "Revert "[InstCombine] Fold 'check for [no] signed trunca...
Roman Lebedev [Wed, 18 Jul 2018 08:15:13 +0000 (08:15 +0000)]
Revert test changes part of "Revert "[InstCombine] Fold 'check for [no] signed truncation' pattern""

We want the test to remain good anyway.
I think the fix is incoming.

This reverts part of commit rL337344.

llvm-svn: 337359

6 years ago[AArch64][SVE] Asm: Support for integer MUL instructions.
Sander de Smalen [Wed, 18 Jul 2018 08:10:03 +0000 (08:10 +0000)]
[AArch64][SVE] Asm: Support for integer MUL instructions.

This patch adds the following instructions:
  MUL   - multiply vectors, e.g.
    mul z0.h, p0/m, z0.h, z1.h
        - multiply with immediate, e.g.
    mul z0.h, z0.h, #127

  SMULH - signed multiply returning high half, e.g.
    smulh z0.h, p0/m, z0.h, z1.h

  UMULH - unsigned multiply returning high half, e.g.
    umulh z0.h, p0/m, z0.h, z1.h

llvm-svn: 337358

6 years ago[X86] Enable commuting of VUNPCKHPD to VMOVLHPS to enable load folding by using VMOVL...
Craig Topper [Wed, 18 Jul 2018 07:31:32 +0000 (07:31 +0000)]
[X86] Enable commuting of VUNPCKHPD to VMOVLHPS to enable load folding by using VMOVLPS with a modified address.

This required an annoying amount of tablegen multiclass changes to make only VUNPCKHPDZ128rr commutable.

llvm-svn: 337357

6 years ago[X86] Add test case for missed opportunity to commute vunpckhpd to enable use of...
Craig Topper [Wed, 18 Jul 2018 07:31:30 +0000 (07:31 +0000)]
[X86] Add test case for missed opportunity to commute vunpckhpd to enable use of vmovlps to fold a load.

We do this transform for SSE, but not AVX or AVX512VL.

llvm-svn: 337356

6 years ago[libomptarget] Also support several images for elf
Joachim Protze [Wed, 18 Jul 2018 07:23:46 +0000 (07:23 +0000)]
[libomptarget] Also support several images for elf

In revision r336569 (D49036) libomptarget support for multiple nvidia images
has been fixed in case a target region resides inside one or multiple
libraries and in the compiled application. But the issues is still present
for elf images.
This fix will also support multiple images for elf.

Patch by Jannis Klinkenberg

Reviewers: protze.joachim, ABataev, grokos

Reviewed By: protze.joachim, ABataev, grokos

Subscribers: openmp-commits

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

llvm-svn: 337355

6 years ago[X86] Regenerate fma.ll checks using current version of the script which produces...
Craig Topper [Wed, 18 Jul 2018 07:08:28 +0000 (07:08 +0000)]
[X86] Regenerate fma.ll checks using current version of the script which produces different regular expressions on spills and reloads. NFC

llvm-svn: 337354

6 years ago[modules] Print input files when -module-file-info file switch is passed.
Vassil Vassilev [Wed, 18 Jul 2018 06:49:33 +0000 (06:49 +0000)]
[modules] Print input files when -module-file-info file switch is passed.

This patch improves traceability of duplicated header files which end
up in multiple pcms.

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

llvm-svn: 337353

6 years ago[AArch64] Define TARGET_HEADER_BUILTIN
Martin Storsjo [Wed, 18 Jul 2018 06:15:09 +0000 (06:15 +0000)]
[AArch64] Define TARGET_HEADER_BUILTIN

Without it, the new intrinsics became available for all language
variants. This was missed in SVN r337327.

llvm-svn: 337352

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Wed, 18 Jul 2018 06:04:43 +0000 (06:04 +0000)]
[NFC] fix trivial typos in comments

llvm-svn: 337351

6 years agoFix build failures from r337347, found by clang
Justin Hibbits [Wed, 18 Jul 2018 05:19:25 +0000 (05:19 +0000)]
Fix build failures from r337347, found by clang

* Delete a no-longer-used override, and mark the other
getRegisterTypeForCallingConv() as override.
* SPE only supports i32, not i64, as the internal type, so simply remove
the type check, so that DestReg and Opc are provably always set.

GCC 6.4 did not warn about either of the above.

llvm-svn: 337350

6 years ago[X86] Remove patterns that mix X86ISD::MOVLHPS/MOVHLPS with v2i64/v2f64 types.
Craig Topper [Wed, 18 Jul 2018 05:10:53 +0000 (05:10 +0000)]
[X86] Remove patterns that mix X86ISD::MOVLHPS/MOVHLPS with v2i64/v2f64 types.

The X86ISD::MOVLHPS/MOVHLPS should now only be emitted in SSE1 only. This means that the v2i64/v2f64 types would be illegal thus we don't need these patterns.

llvm-svn: 337349

6 years ago[X86] Generate v2f64 X86ISD::UNPCKL/UNPCKH instead of X86ISD::MOVLHPS/MOVHLPS for...
Craig Topper [Wed, 18 Jul 2018 05:10:51 +0000 (05:10 +0000)]
[X86] Generate v2f64 X86ISD::UNPCKL/UNPCKH instead of X86ISD::MOVLHPS/MOVHLPS for unary v2f64 {0,0} and {1,1} shuffles with SSE2.

I'm trying to restrict the MOVLHPS/MOVHLPS ISD nodes to SSE1 only. With SSE2 we can use unpcks. I believe this will allow some patterns to be cleaned up to require fewer bitcasts.

I've put in an odd isel hack to still select MOVHLPS instruction from the unpckh node to avoid changing tests and because movhlps is a shorter encoding. Ideally we'd do execution domain switching on this, but the operands are in the wrong order and are tied. We might be able to try a commute in the domain switching using custom code.

We already support domain switching for UNPCKLPD and MOVLHPS.

llvm-svn: 337348

6 years agoIntroduce codegen for the Signal Processing Engine
Justin Hibbits [Wed, 18 Jul 2018 04:25:10 +0000 (04:25 +0000)]
Introduce codegen for the Signal Processing Engine

Summary:
The Signal Processing Engine (SPE) is found on NXP/Freescale e500v1,
e500v2, and several e200 cores.  This adds support targeting the e500v2,
as this is more common than the e500v1, and is in SoCs still on the
market.

This patch is very intrusive because the SPE is binary incompatible with
the traditional FPU.  After discussing with others, the cleanest
solution was to make both SPE and FPU features on top of a base PowerPC
subset, so all FPU instructions are now wrapped with HasFPU predicates.

Supported by this are:
* Code generation following the SPE ABI at the LLVM IR level (calling
conventions)
* Single- and Double-precision math at the level supported by the APU.

Still to do:
* Vector operations
* SPE intrinsics

As this changes the Callee-saved register list order, one test, which
tests the precise generated code, was updated to account for the new
register order.

Reviewed by: nemanjai
Differential Revision: https://reviews.llvm.org/D44830

llvm-svn: 337347

6 years agoComplete the SPE instruction set patterns
Justin Hibbits [Wed, 18 Jul 2018 04:24:57 +0000 (04:24 +0000)]
Complete the SPE instruction set patterns

This is the lead-up to having SPE codegen.  Add the rest of the
instructions, along with MC tests.

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

llvm-svn: 337346

6 years agoAdd PowerPC e500(v2) core scheduler and directives.
Justin Hibbits [Wed, 18 Jul 2018 04:24:49 +0000 (04:24 +0000)]
Add PowerPC e500(v2) core scheduler and directives.

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

llvm-svn: 337345

6 years agoRevert "[InstCombine] Fold 'check for [no] signed truncation' pattern"
Bob Haarman [Wed, 18 Jul 2018 02:18:28 +0000 (02:18 +0000)]
Revert "[InstCombine] Fold 'check for [no] signed truncation' pattern"

This reverts r337190 (and a few follow-up commits), which caused the
Chromium build to fail. See
https://bugs.llvm.org/show_bug.cgi?id=38204 and
https://crbug.com/864832

llvm-svn: 337344

6 years ago[XRay][compiler-rt] Segmented Array: Simplify and Optimise
Dean Michael Berris [Wed, 18 Jul 2018 02:08:39 +0000 (02:08 +0000)]
[XRay][compiler-rt] Segmented Array: Simplify and Optimise

Summary:
This is a follow-on to D49217 which simplifies and optimises the
implementation of the segmented array. In this patch we co-locate the
book-keeping for segments in the `__xray::Array<T>` with the data it's
managing. We take the chance in this patch to actually rename `Chunk` to
`Segment` to better align with the high-level description of the
segmented array.

With measurements using benchmarks landed in D48879, we've identified
that calls to `pthread_getspecific` started dominating the cycles, which
led us to revert the change made in D49217 to use C++ thread_local
initialisation instead (it reduces the cost by a huge margin, since we
save one PLT-based call to pthread functions in the hot path). In
particular, this is in `__xray::getThreadLocalData()`.

We also took the opportunity to remove the least-common-multiple based
calculation and instead pack as much data into segments of the array.
This greatly simplifies the API of the container which hides as much of
the implementation details as possible. For instance, we calculate the
number of elements we need for the each segment internally in the Array
instead of making it part of the type.

With the changes here, we're able to get a measurable improvement on the
performance of profiling mode on top of what D48879 already provides.

Depends on D48879.

Reviewers: kpw, eizan

Subscribers: llvm-commits

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

llvm-svn: 337343

6 years ago[XRay][compiler-rt] Simplify Allocator Implementation
Dean Michael Berris [Wed, 18 Jul 2018 01:53:39 +0000 (01:53 +0000)]
[XRay][compiler-rt] Simplify Allocator Implementation

Summary:
This change simplifies the XRay Allocator implementation to self-manage
an mmap'ed memory segment instead of using the internal allocator
implementation in sanitizer_common.

We've found through benchmarks and profiling these benchmarks in D48879
that using the internal allocator in sanitizer_common introduces a
bottleneck on allocating memory through a central spinlock. This change
allows thread-local allocators to eliminate contention on the
centralized allocator.

To get the most benefit from this approach, we also use a managed
allocator for the chunk elements used by the segmented array
implementation. This gives us the chance to amortize the cost of
allocating memory when creating these internal segmented array data
structures.

We also took the opportunity to remove the preallocation argument from
the allocator API, simplifying the usage of the allocator throughout the
profiling implementation.

In this change we also tweak some of the flag values to reduce the
amount of maximum memory we use/need for each thread, when requesting
memory through mmap.

Depends on D48956.

Reviewers: kpw, eizan

Subscribers: llvm-commits

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

llvm-svn: 337342

6 years ago[XRay][compiler-rt] FDR Mode: Allow multiple runs
Dean Michael Berris [Wed, 18 Jul 2018 01:31:30 +0000 (01:31 +0000)]
[XRay][compiler-rt] FDR Mode: Allow multiple runs

Summary:
Fix a bug in FDR mode which didn't allow for re-initialising the logging
in the same process. This change ensures that:

- When we flush the FDR mode logging, that the state of the logging
  implementation is `XRAY_LOG_UNINITIALIZED`.

- Fix up the thread-local initialisation to use aligned storage and
  `pthread_getspecific` as well as `pthread_setspecific` for the
  thread-specific data.

- Actually use the pointer provided to the thread-exit cleanup handling,
  instead of assuming that the thread has thread-local data associated
  with it, and reaching at thread-exit time.

In this change we also have an explicit test for two consecutive
sessions for FDR mode tracing, and ensuring both sessions succeed.

Reviewers: kpw, eizan

Subscribers: llvm-commits

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

llvm-svn: 337341

6 years agoWorkaround warning bug in old versions of gcc.
Sterling Augustine [Wed, 18 Jul 2018 00:33:25 +0000 (00:33 +0000)]
Workaround warning bug in old versions of gcc.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

llvm-svn: 337340

6 years agoRe-land r337333, "Teach Clang to emit address-significance tables.",
Peter Collingbourne [Wed, 18 Jul 2018 00:27:07 +0000 (00:27 +0000)]
Re-land r337333, "Teach Clang to emit address-significance tables.",
which was reverted in r337336.

The problem that required a revert was fixed in r337338.

Also added a missing "REQUIRES: x86-registered-target" to one of
the tests.

Original commit message:
> Teach Clang to emit address-significance tables.
>
> By default, we emit an address-significance table on all ELF
> targets when the integrated assembler is enabled. The emission of an
> address-significance table can be controlled with the -faddrsig and
> -fno-addrsig flags.
>
> Differential Revision: https://reviews.llvm.org/D48155

llvm-svn: 337339

6 years agoCodeGen: Don't create address significance table entries for thread-local variables.
Peter Collingbourne [Wed, 18 Jul 2018 00:21:40 +0000 (00:21 +0000)]
CodeGen: Don't create address significance table entries for thread-local variables.

The presence of these symbols in the symbol table can cause symbol type
mismatch errors (or undefined symbol errors on emulated TLS targets)
and they can't be ICF'd anyway.

llvm-svn: 337338

6 years ago[NFC][llvm-objcopy] Cleanup namespace usage in llvm-objcopy.
Puyan Lotfi [Wed, 18 Jul 2018 00:10:51 +0000 (00:10 +0000)]
[NFC][llvm-objcopy] Cleanup namespace usage in llvm-objcopy.

Nest any classes not used outside of a file into anon. Nest any classes used
across files in llvm-objcopy into namespace llvm::objcopy.

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

llvm-svn: 337337

6 years agoRevert r337333, "Teach Clang to emit address-significance tables."
Peter Collingbourne [Tue, 17 Jul 2018 23:56:30 +0000 (23:56 +0000)]
Revert r337333, "Teach Clang to emit address-significance tables."

Causing multiple failures on sanitizer bots due to TLS symbol errors,
e.g.

/usr/bin/ld: __msan_origin_tls: TLS definition in /home/buildbots/ppc64be-clang-test/clang-ppc64be/stage1/lib/clang/7.0.0/lib/linux/libclang_rt.msan-powerpc64.a(msan.cc.o) section .tbss.__msan_origin_tls mismatches non-TLS reference in /tmp/lit_tmp_0a71tA/mallinfo-3ca75e.o

llvm-svn: 337336

6 years agoLink the lldb driver ("lldb") against the llvm static
Jason Molenda [Tue, 17 Jul 2018 23:44:09 +0000 (23:44 +0000)]
Link the lldb driver ("lldb") against the llvm static
libraries because of the new prettystackprinter dependency.

llvm-svn: 337335

6 years ago[X86] Remove the vector alignment requirement from the patterns added in r337320.
Craig Topper [Tue, 17 Jul 2018 23:26:20 +0000 (23:26 +0000)]
[X86] Remove the vector alignment requirement from the patterns added in r337320.

The resulting instruction will only load 64 bits so alignment isn't required.

llvm-svn: 337334

6 years agoTeach Clang to emit address-significance tables.
Peter Collingbourne [Tue, 17 Jul 2018 23:17:16 +0000 (23:17 +0000)]
Teach Clang to emit address-significance tables.

By default, we emit an address-significance table on all ELF
targets when the integrated assembler is enabled. The emission of an
address-significance table can be controlled with the -faddrsig and
-fno-addrsig flags.

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

llvm-svn: 337333

6 years agoImplement framework for linking split-stack object files, and x86_64 support.
Sterling Augustine [Tue, 17 Jul 2018 23:16:02 +0000 (23:16 +0000)]
Implement framework for linking split-stack object files, and x86_64 support.

llvm-svn: 337332

6 years agoCodeGen: Add a target option for emitting .addrsig directives for all address-signifi...
Peter Collingbourne [Tue, 17 Jul 2018 22:40:08 +0000 (22:40 +0000)]
CodeGen: Add a target option for emitting .addrsig directives for all address-significant symbols.

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

llvm-svn: 337331

6 years agoReplace LLVM_ALIGNAS with just alignas.
Richard Smith [Tue, 17 Jul 2018 22:24:11 +0000 (22:24 +0000)]
Replace LLVM_ALIGNAS with just alignas.

Various places in Clang and LLVM are already using alignas; it seems
our minimum host configuration now requires it.

llvm-svn: 337330

6 years agoRestructure checking for, and warning on, lifetime extension.
Richard Smith [Tue, 17 Jul 2018 22:24:09 +0000 (22:24 +0000)]
Restructure checking for, and warning on, lifetime extension.

This change implements C++ DR1696, which makes initialization of a
reference member of a class from a temporary object ill-formed. The
standard wording here is imprecise, but we interpret it as meaning that
any time a mem-initializer would result in lifetime extension, the
program is ill-formed.

This reinstates r337226, reverted in r337255, with a fix for the
InitializedEntity alignment problem that was breaking ARM buildbots.

llvm-svn: 337329

6 years agoMC: Implement support for new .addrsig and .addrsig_sym directives.
Peter Collingbourne [Tue, 17 Jul 2018 22:17:18 +0000 (22:17 +0000)]
MC: Implement support for new .addrsig and .addrsig_sym directives.

Part of the address-significance tables proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html

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

llvm-svn: 337328

6 years ago[COFF] Add more missing MSVC ARM64 intrinsics
Mandeep Singh Grang [Tue, 17 Jul 2018 22:03:24 +0000 (22:03 +0000)]
[COFF] Add more missing MSVC ARM64 intrinsics

Summary:
Added the following intrinsics:
_BitScanForward, _BitScanReverse, _BitScanForward64, _BitScanReverse64
_InterlockedAnd64, _InterlockedDecrement64, _InterlockedExchange64,
_InterlockedExchangeAdd64, _InterlockedExchangeSub64,
_InterlockedIncrement64, _InterlockedOr64, _InterlockedXor64.

Reviewers: compnerd, mstorsjo, rnk, javed.absar

Reviewed By: mstorsjo

Subscribers: kristof.beyls, chrib, llvm-commits

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

llvm-svn: 337327

6 years ago[LangRef] Clarify semantics of load metadata.
Eli Friedman [Tue, 17 Jul 2018 20:38:11 +0000 (20:38 +0000)]
[LangRef] Clarify semantics of load metadata.

We need to explicitly state what happens when an invariant promised by
load metadata is violated at runtime, since it's come up repeatedly.

It's possible we want to specify that the result of the load is poison
in some cases, rather than undefined behavior, if the constraint is
violated. That would allow preserving the metadata when the load is
hoisted, but doesn't allow propagating metadata based on control flow.
We currently do transforms based on control flow for nonnull metadata
(in PromoteMemToReg).

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

llvm-svn: 337325

6 years ago[libFuzzer] Mutation tracking and logging implemented.
Max Moroz [Tue, 17 Jul 2018 20:37:40 +0000 (20:37 +0000)]
[libFuzzer] Mutation tracking and logging implemented.

Summary:
Code now exists to track number of mutations that are used in fuzzing in total
and ones that produce new coverage. The stats are currently being dumped to the
command line.

Patch by Kodé Williams (@kodewilliams).

Reviewers: metzman, Dor1s, morehouse, kcc

Reviewed By: Dor1s, morehouse, kcc

Subscribers: delcypher, kubamracek, kcc, morehouse, llvm-commits, #sanitizers, mgorny

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

llvm-svn: 337324

6 years ago[LangRef] nnan and ninf produce poison.
Eli Friedman [Tue, 17 Jul 2018 20:31:42 +0000 (20:31 +0000)]
[LangRef] nnan and ninf produce poison.

Clarify that violating nnan and ninf can lead to undefined behavior.
This allows more aggressive optimizations based on those assumptions.

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

llvm-svn: 337323

6 years ago[LangRef] Clarify which fast-math flags affect fcmp.
Eli Friedman [Tue, 17 Jul 2018 20:28:31 +0000 (20:28 +0000)]
[LangRef] Clarify which fast-math flags affect fcmp.

nsz has no effect due to the way fcmp is defined; +0 and -0 compare
equal anyway. reassoc could have the obvious effect.

llvm-svn: 337322

6 years agoRemove unnecessary trailing ; in macro intrinsic definition.
Eric Christopher [Tue, 17 Jul 2018 20:22:17 +0000 (20:22 +0000)]
Remove unnecessary trailing ; in macro intrinsic definition.

llvm-svn: 337321

6 years ago[X86] Add patterns for folding full vector load into MOVHPS and MOVLPS with SSE1...
Craig Topper [Tue, 17 Jul 2018 20:16:18 +0000 (20:16 +0000)]
[X86] Add patterns for folding full vector load into MOVHPS and MOVLPS with SSE1 only.

llvm-svn: 337320

6 years ago[X86] Add test case for missed opportunity to use MOVLPS on the SSE1 only targets.
Craig Topper [Tue, 17 Jul 2018 20:16:15 +0000 (20:16 +0000)]
[X86] Add test case for missed opportunity to use MOVLPS on the SSE1 only targets.

llvm-svn: 337319

6 years ago[Demangle] Add missing header files
Fangrui Song [Tue, 17 Jul 2018 19:50:41 +0000 (19:50 +0000)]
[Demangle] Add missing header files

llvm-svn: 337318

6 years agoAdd missing include.
Zachary Turner [Tue, 17 Jul 2018 19:48:46 +0000 (19:48 +0000)]
Add missing include.

llvm-svn: 337317

6 years agoAdd some helper functions to the demangle utility classes.
Zachary Turner [Tue, 17 Jul 2018 19:42:29 +0000 (19:42 +0000)]
Add some helper functions to the demangle utility classes.

These are all methods that, while not currently used in the
Itanium demangler, are generally useful enough that it's
likely the itanium demangler could find a use for them.  More
importantly, they are all necessary for the Microsoft demangler
which is up and coming in a subsequent patch.  Rather than
combine these into a single monolithic patch, I think it makes
sense to commit this utility code first since it is very simple,
this way it won't detract from the substance of the MS demangler
patch.

llvm-svn: 337316

6 years ago[WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbols
Sam Clegg [Tue, 17 Jul 2018 19:15:02 +0000 (19:15 +0000)]
[WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbols

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

llvm-svn: 337314

6 years ago[builtins] Implement the __chkstk function for ARM for MinGW
Martin Storsjo [Tue, 17 Jul 2018 19:14:47 +0000 (19:14 +0000)]
[builtins] Implement the __chkstk function for ARM for MinGW

This function is available for linking in from kernel32.dll, but
it's not allowed to link that function from there in Windows Store
apps.

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

llvm-svn: 337313

6 years agoThe semantics of DW_CFA_GNU_args_size have changed subtile over the
Joerg Sonnenberger [Tue, 17 Jul 2018 19:00:51 +0000 (19:00 +0000)]
The semantics of DW_CFA_GNU_args_size have changed subtile over the
years. Adopt the new convention that it is call-site specific and that
it should be applied before moving the IP by personality routines, but
not during normal unwinding.

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

llvm-svn: 337312

6 years agoInvert dependency between lldb-framework and lldb-suite
Alex Langford [Tue, 17 Jul 2018 18:28:51 +0000 (18:28 +0000)]
Invert dependency between lldb-framework and lldb-suite

Summary:
Currently, if you build lldb-framework the entire framework doesn't
actually build. In order to build the entire framework, you need to actually
build lldb-suite. This abstraction doesn't feel quite right because
lldb-framework truly does depend on lldb-suite (liblldb + related tools).

In this change I want to invert their dependency. This will mean that lldb and
finish_swig will depend on lldb-framework in a framework build, and lldb-suite
otherwise. Instead of adding conditional logic everywhere to handle this, I
introduce LLDB_SUITE_TARGET to handle it.

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

llvm-svn: 337311

6 years ago[InstCombine] Preserve debug value when simplifying cast-of-select
Vedant Kumar [Tue, 17 Jul 2018 18:08:36 +0000 (18:08 +0000)]
[InstCombine] Preserve debug value when simplifying cast-of-select

InstCombine has a cast transform that matches a cast-of-select:

  Orig = cast (Src = select Cond TV FV)

And tries to replace it with a select which has the cast folded in:

  NewSel = select Cond (cast TV) (cast FV)

The combiner does RAUW(Orig, NewSel), so any debug values for Orig would
survive the transform. But debug values for Src would be lost.

This patch teaches InstCombine to replace all debug uses of Src with
NewSel (taking care of doing any necessary DIExpression rewriting).

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

llvm-svn: 337310

6 years agoRemove an errant piece of !dbg metadata from a test, NFC
Vedant Kumar [Tue, 17 Jul 2018 18:08:34 +0000 (18:08 +0000)]
Remove an errant piece of !dbg metadata from a test, NFC

llvm-svn: 337309

6 years ago[x86/SLH] Flesh out the data-invariant instruction table a bit based on feedback...
Chandler Carruth [Tue, 17 Jul 2018 18:07:59 +0000 (18:07 +0000)]
[x86/SLH] Flesh out the data-invariant instruction table a bit based on feedback from Craig.

Summary:
The only thing he suggested that I've skipped here is the double-wide
multiply instructions. Multiply is an area I'm nervous about there being
some hidden data-dependent behavior, and it doesn't seem important for
any benchmarks I have, so skipping it and sticking with the minimal
multiply support that matches what I know is widely used in existing
crypto libraries. We can always add double-wide multiply when we have
clarity from vendors about its behavior and guarantees.

I've tried to at least cover the fundamentals here with tests, although
I've not tried to cover every width or permutation. I can add more tests
where folks think it would be helpful.

Reviewers: craig.topper

Subscribers: sanjoy, mcrosier, hiraditya, llvm-commits

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

llvm-svn: 337308

6 years ago[llvm-mca][x86] Add extend, carry-flag and CMP instructions to general x86_64 resourc...
Simon Pilgrim [Tue, 17 Jul 2018 17:47:35 +0000 (17:47 +0000)]
[llvm-mca][x86] Add extend, carry-flag and CMP instructions to general x86_64 resource tests

llvm-svn: 337306

6 years ago[llvm-mca][x86] Add MOVBE resource tests to all supporting targets
Simon Pilgrim [Tue, 17 Jul 2018 17:41:45 +0000 (17:41 +0000)]
[llvm-mca][x86] Add MOVBE resource tests to all supporting targets

SNB doesn't support MOVBE but the numbers in Generic (which use the SNB model) look sane.

llvm-svn: 337305

6 years ago[analyzer] Fix Z3 backend after D48205
Mikhail R. Gadelha [Tue, 17 Jul 2018 17:40:34 +0000 (17:40 +0000)]
[analyzer] Fix Z3 backend after D48205

Summary:
An assertion was added in D48205 to catch places where a `nonloc::SymbolVal` was wrapping a `loc` object.

This patch fixes that in the Z3 backend by making the `SValBuilder` object accessible from inherited instances of `SimpleConstraintManager` and calling `SVB.makeSymbolVal(foo)` instead of `nonloc::SymbolVal(foo)`.

Reviewers: NoQ, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 337304

6 years agoRevert rL337292 due to another MSVC STL problem.
Florian Hahn [Tue, 17 Jul 2018 17:12:50 +0000 (17:12 +0000)]
Revert rL337292 due to another MSVC STL problem.

llvm-svn: 337303

6 years ago[llvm-mca][x86] Add BSWAP resource tests
Simon Pilgrim [Tue, 17 Jul 2018 17:10:47 +0000 (17:10 +0000)]
[llvm-mca][x86] Add BSWAP resource tests

llvm-svn: 337302

6 years ago[WebAssembly] Update WebAssemblyLowerEmscriptenEHSjLj to handle separate compilation
Sam Clegg [Tue, 17 Jul 2018 16:40:03 +0000 (16:40 +0000)]
[WebAssembly] Update WebAssemblyLowerEmscriptenEHSjLj to handle separate compilation

Previously we were assuming whole program compilation. Now that
separate compilation is a thing we need to update this pass.
Firstly, it can no longer assert on the existence of malloc and free.
This functions might not be in the current translation unit.  If we
need them then we will generate not imports for them.

Secondly the global helper function we create should be marked as
weak since we will be generating a separate copy in each translation
unit.

Finally the names of the symbols used must be unique and fixed since
they need to agree across translation units.

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

llvm-svn: 337301

6 years agoAdd wasm-ld to help text Improve error text
Sam Clegg [Tue, 17 Jul 2018 16:34:48 +0000 (16:34 +0000)]
Add wasm-ld to help text Improve error text

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

llvm-svn: 337300

6 years ago[X86] Remove some standalone patterns in favor of the patterns in the MOVLPD instruct...
Craig Topper [Tue, 17 Jul 2018 16:24:33 +0000 (16:24 +0000)]
[X86] Remove some standalone patterns in favor of the patterns in the MOVLPD instruction definitions.

Previously we passed 'null_frag' into the instruction definition. The multiclass is shared with MOVHPD which doesn't use null_frag. It turns out by passing X86Movsd it produces patterns equivalent to some standalone patterns.

llvm-svn: 337299

6 years ago[llvm-mca][x86] Add displacement-only and additional scale=1 LEA tests
Simon Pilgrim [Tue, 17 Jul 2018 16:17:33 +0000 (16:17 +0000)]
[llvm-mca][x86] Add displacement-only and additional scale=1 LEA tests

llvm-svn: 337298

6 years ago[llvm-mca][x86] Add LEA resource tests (PR32326)
Simon Pilgrim [Tue, 17 Jul 2018 16:13:29 +0000 (16:13 +0000)]
[llvm-mca][x86] Add LEA resource tests (PR32326)

Add llvm-mca tests demonstrating how LEA instructions are currently modelled. Once this is working on btver2 I'll copy the test file to the other target directories.

llvm-svn: 337297

6 years agolibFuzzer: prevent irrelevant strings from leaking into auto-dictionary
Matt Morehouse [Tue, 17 Jul 2018 16:12:00 +0000 (16:12 +0000)]
libFuzzer: prevent irrelevant strings from leaking into auto-dictionary

This is a fix for bug 37047.

https://bugs.llvm.org/show_bug.cgi?id=37047

Implemented by basically reversing the logic. Previously all strings
were considered, with some operations excluded. Now strings are excluded
by default, and only strings during the CB considered.

Patch By: pdknsk

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

llvm-svn: 337296

6 years ago[llvm-mca][docs] Revert mca internals docs.
Matt Davis [Tue, 17 Jul 2018 16:11:54 +0000 (16:11 +0000)]
[llvm-mca][docs] Revert mca internals docs.

We're going to work on this in a separate review focusing more on documenting
the View and probably removing some of the less-interesting/less-useful pieces.

This reverts r337219,337225

llvm-svn: 337295

6 years ago[Tablegen][PredicateExpander] Fix a bug in `expandCheckImmOperand`.
Andrea Di Biagio [Tue, 17 Jul 2018 16:11:37 +0000 (16:11 +0000)]
[Tablegen][PredicateExpander] Fix a bug in `expandCheckImmOperand`.

Function `expandCheckImmOperand` should always check if the input machine
instruction is passed by reference before calling method `getOperand()` on it.

Found while working on a patch that relies on `expandCheckImmOperand` to expand
a scheduling predicate.

llvm-svn: 337294

6 years ago[AArch64][SVE]: Integer multiply-add/subtract instructions.
Sander de Smalen [Tue, 17 Jul 2018 15:41:58 +0000 (15:41 +0000)]
[AArch64][SVE]: Integer multiply-add/subtract instructions.

This patch adds support for the following instructions:
  MLA  mul-add, writing addend       (Zda = Zda +   Zn * Zm)
  MLS  mul-sub, writing addend       (Zda = Zda +  -Zn * Zm)
  MAD  mul-add, writing multiplicant (Zdn =  Za +  Zdn * Zm)
  MSB  mul-sub, writing multiplicant (Zdn =  Za + -Zdn * Zm)

llvm-svn: 337293

6 years agoRecommit r334887: [SmallSet] Add SmallSetIterator.
Florian Hahn [Tue, 17 Jul 2018 15:24:19 +0000 (15:24 +0000)]
Recommit r334887: [SmallSet] Add SmallSetIterator.

Spell out destructor, copy/move constructor and assignment operators for
MSVC STL, where set<T>::const_iterator is not trivially copy constructible.

llvm-svn: 337292

6 years ago[CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIR
Jonas Devlieghere [Tue, 17 Jul 2018 15:11:15 +0000 (15:11 +0000)]
[CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIR

llvm-lit uses `map_config` directives (generated at configuration-time) to
make it possible to pass a test path relative to the source instead of
the build folder (CMAKE_CURRENT_BINARY_DIR).

However, this doesn't work in the case of swift where the build
directory layout prevents llvm-lit from knowing about lldb and its test
paths. This caused check-lldb-unit to fail in this configuration, while
everything was working as expected upstream. This patch fixes the issue
by passing a path relative to the build directory. This was already the
case for check-lldb-lit.

llvm-svn: 337291

6 years agoclang-cl: Postpone Wmsvc-not-found emission until link.exe gets used.
Nico Weber [Tue, 17 Jul 2018 15:07:40 +0000 (15:07 +0000)]
clang-cl: Postpone Wmsvc-not-found emission until link.exe gets used.

Wmsvc-not-found was added in r297851 to help diagnose why link.exe can't be
executed. However, it's emitted even when using -fuse-ld=lld, and in cross
builds there's no way to get rid of the warning other than disabling it.

Instead, emit it when we look up link.exe and it ends up not being executable.
That way, when passing -fuse-ld=lld it will never be printed.
It will also not be printed if we find link.exe on PATH.

(We might want to eventually default to lld one day, at least when running on a
non-Win host, but that's for another day.)

Fixes PR38016.

llvm-svn: 337290

6 years ago[Fixed Point Arithmetic] Fix for bug where integer literals could be treated as fixed...
Leonard Chan [Tue, 17 Jul 2018 14:58:49 +0000 (14:58 +0000)]
[Fixed Point Arithmetic] Fix for bug where integer literals could be treated as fixed point literals

This addresses a bug brought up in https://bugs.llvm.org/show_bug.cgi?id=38161 where integer literals could be treated as fixed point types and throw errors related to fixed point types when the 'k' or 'r' suffix used. The fix also addresses the second issue brought up with the assertion by not treating integers as fixed point types in the first place.

Integers that have suffixes 'k' and 'r' now throw the error `invalid suffix 'k/r' on integer constant`.

A few more tests were also added to ensure that fixed point types, and any errors/warnings related to them, are limited to C for now.

Prior discussion also at https://reviews.llvm.org/D46915.

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

llvm-svn: 337289

6 years ago[Mips][FastISel] Fix handling of icmp with i1 type
Petar Jovanovic [Tue, 17 Jul 2018 14:57:46 +0000 (14:57 +0000)]
[Mips][FastISel] Fix handling of icmp with i1 type

The Mips FastISel back-end does not extend i1 values while lowering icmp.
Ensure that we bail into DAG ISel when handling this case.

Patch by Dragan Mladjenovic.

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

llvm-svn: 337288

6 years ago[ELF] - Eliminate dead 'return' in EhFrameSection::finalizeContents(). NFC.
George Rimar [Tue, 17 Jul 2018 14:36:19 +0000 (14:36 +0000)]
[ELF] - Eliminate dead 'return' in EhFrameSection::finalizeContents(). NFC.

EhFrameSection::finalizeContents() is called from a single place:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1559

So code was dead.

llvm-svn: 337287

6 years ago[clang-tidy: modernize] Fix modernize-use-equals-default with {} brackets list initia...
Idriss Riouak [Tue, 17 Jul 2018 14:35:15 +0000 (14:35 +0000)]
[clang-tidy: modernize] Fix modernize-use-equals-default with {} brackets list initialization: patch

Summary:
Hello, i would like to suggest a fix for one of the checks in clang-tidy.
The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=38039 where you can find more information.

```
struct UOB{
UOB(const UOB &Other):j{Other.j}{}
int j;
};
```
In this case the check modernize-use-equals-default does not detect copy constructors that can be defaulted; that should be:

```
struct UOB{
UOB(const UOB &Other) = default;
int j;
};
```

Reviewers: aaron.ballman, hokein, alexfh

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 337286

6 years agoRemove superfluous ; to fix -Wpedantic warning from gcc
Nico Weber [Tue, 17 Jul 2018 14:20:02 +0000 (14:20 +0000)]
Remove superfluous ; to fix -Wpedantic warning from gcc

llvm-svn: 337285

6 years ago[Tooling] Add operator== to CompileCommand
Simon Marchi [Tue, 17 Jul 2018 14:13:05 +0000 (14:13 +0000)]
[Tooling] Add operator== to CompileCommand

Summary:
It does the obvious thing of comparing all fields.  This will be needed
for a clangd patch I have in the pipeline.

Subscribers: dblaikie, ilya-biryukov, ioeric, cfe-commits

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

llvm-svn: 337284

6 years ago[IPSCCP] Run Solve each time we resolved an undef in a function.
Florian Hahn [Tue, 17 Jul 2018 14:04:59 +0000 (14:04 +0000)]
[IPSCCP] Run Solve each time we resolved an undef in a function.

Once we resolved an undef in a function we can run Solve, which could
lead to finding a constant return value for the function, which in turn
could turn undefs into constants in other functions that call it, before
resolving undefs there.

Computationally the amount of work we are doing stays the same, just the
order we process things is slightly different and potentially there are
a few less undefs to resolve.

We are still relying on the order of functions in the IR, which means
depending on the order, we are able to resolve the optimal undef first
or not. For example, if @test1 comes before @testf, we find the constant
return value of @testf too late and we cannot use it while solving
@test1.

This on its own does not lead to more constants removed in the
test-suite, probably because currently we have to be very lucky to visit
applicable functions in the right order.

Maybe we manage to come up with a better way of resolving undefs in more
'profitable' functions first.

Reviewers: efriedma, mssimpso, davide

Reviewed By: efriedma, davide

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

llvm-svn: 337283

6 years ago[AArch64][SVE] Asm: FP fused multiply-add/subtract instructions.
Sander de Smalen [Tue, 17 Jul 2018 13:58:46 +0000 (13:58 +0000)]
[AArch64][SVE] Asm: FP fused multiply-add/subtract instructions.

This patch adds support for the following instructions:

  FMLA    mul-add, writing addend                (Zda =  Zda +   Zn * Zm)
  FNMLA   negated mul-add, writing addend        (Zda = -Zda +  -Zn * Zm)

  FMLS    mul-sub, writing addend                (Zda =  Zda +  -Zn * Zm)
  FNMLS   negated mul-sub, writing addend        (Zda = -Zda +   Zn * Zm)

  FMAD    mul-add, writing multiplicant          (Zdn =  Za  +  Zdn * Zm)
  FNMAD   negated mul-add, writing multiplicant  (Zdn = -Za  + -Zdn * Zm)

  FMSB    mul-sub, writing multiplicant          (Zdn =  Za  + -Zdn * Zm)
  FNMSB   negated mul-sub, writing multiplicant  (Zdn = -Za  +  Zdn * Zm)

llvm-svn: 337282

6 years ago[ELF] - Remove dead code from EhFrameSection::addCie. NFC.
George Rimar [Tue, 17 Jul 2018 13:56:23 +0000 (13:56 +0000)]
[ELF] - Remove dead code from EhFrameSection::addCie. NFC.

Code was dead because caller of the addCie() already
checks that ID is equal to 0:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L431

llvm-svn: 337281

6 years ago[SLPVectorizer] Don't attempt horizontal reduction on pointer types (PR38191)
Simon Pilgrim [Tue, 17 Jul 2018 13:43:33 +0000 (13:43 +0000)]
[SLPVectorizer] Don't attempt horizontal reduction on pointer types (PR38191)

TTI::getMinMaxReductionCost typically can't handle pointer types - until this is changed its better to limit horizontal reduction to integer/float vector types only.

llvm-svn: 337280

6 years agoRevert "[Sema] Reword warning for constant captures that are not required"
Benjamin Kramer [Tue, 17 Jul 2018 13:17:01 +0000 (13:17 +0000)]
Revert "[Sema] Reword warning for constant captures that are not required"

This reverts commit r337152. This applies to non-constants too. The real
explanation is that the capture is not ODR-used, but putting that into
the warning message seems ... worse.

llvm-svn: 337278

6 years agoAlways use __mcount on NetBSD. Some platforms don't provide _mcount.
Joerg Sonnenberger [Tue, 17 Jul 2018 13:13:34 +0000 (13:13 +0000)]
Always use __mcount on NetBSD. Some platforms don't provide _mcount.

llvm-svn: 337277

6 years ago[ELF] - Eliminate dead code. NFC.
George Rimar [Tue, 17 Jul 2018 13:13:08 +0000 (13:13 +0000)]
[ELF] - Eliminate dead code. NFC.

Code was dead because at the moment of BssSection creation
it can never have a parent. Also, code simply does not
make sence as alignment adjastment happens when
BssSection is added to its parent later.

llvm-svn: 337276

6 years ago[ASTImporter] Fix poisonous structural equivalence cache
Gabor Marton [Tue, 17 Jul 2018 12:39:27 +0000 (12:39 +0000)]
[ASTImporter] Fix poisonous structural equivalence cache

Summary:
Implementation functions call into the member functions of
ASTStructuralEquivalence, thus they can falsely alter the DeclsToCheck state
(they add decls).  This results that some leaf declarations can be stated as
inequivalent as a side effect of one inequivalent element in the DeclsToCheck
list.  And since we store the non-equivalencies, any (otherwise independent)
decls will be rendered as non-equivalent.  Solution: I tried to clearly
separate the implementation functions (the static ones) and the public
interface.  From now on, the implementation functions do not call any public
member functions, only other implementation functions.

Reviewers: a.sidorin, a_sidorin, r.stahl

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 337275

6 years agoFor NetBSD, unwind data is emitted by default, so also enable frame
Joerg Sonnenberger [Tue, 17 Jul 2018 12:38:57 +0000 (12:38 +0000)]
For NetBSD, unwind data is emitted by default, so also enable frame
pointer optimisation by default when using optimisation.

llvm-svn: 337274

6 years agoMore fixes for subreg join failure in RegCoalescer
Tim Renouf [Tue, 17 Jul 2018 12:38:39 +0000 (12:38 +0000)]
More fixes for subreg join failure in RegCoalescer

Summary:
Part of the adjustCopiesBackFrom method wasn't correctly dealing with SubRange
intervals when updating.

2 changes. The first to ensure that bogus SubRange Segments aren't propagated when
encountering Segments of the form [1234r, 1234d:0) when preparing to merge value
numbers. These can be removed in this case.

The second forces a shrinkToUses call if SubRanges end on the copy index
(instead of just the parent register).

V2: Addressed review comments, plus MIR test instead of ll test

Subscribers: MatzeB, qcolombet, nhaehnle

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

Change-Id: I1d2b2b4beea802fce11da01edf71feb2064aab05
llvm-svn: 337273

6 years ago[AArch64][SVE] Asm: Support for predicated FP operations (FP immediate)
Sander de Smalen [Tue, 17 Jul 2018 12:36:08 +0000 (12:36 +0000)]
[AArch64][SVE] Asm: Support for predicated FP operations (FP immediate)

This patch completes support for the following floating point
instructions that take FP immediates:
  FADD*  (addition)
  FSUB   (subtract)
  FSUBR  (subtract reverse form)
  FMUL*  (multiplication)
  FMAX*  (maximum)
  FMAXNM (maximum number)
  FMIN   (maximum)
  FMINNM (maximum number)

All operations are predicated and take a FP immediate operand,
e.g.

  fadd z0.h, p0/m, z0.h, #0.5
  fmin z0.s, p0/m, z0.s, #1.0
        ^___________^ (tied)

* Instructions added in a previous patch.

llvm-svn: 337272

6 years agoBy popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64
Joerg Sonnenberger [Tue, 17 Jul 2018 12:33:19 +0000 (12:33 +0000)]
By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64
to long for consistency with other 64bit platforms.

llvm-svn: 337271

6 years ago[NFC][testcases] add testcases for folding srem whose operands are negatived.
Chen Zheng [Tue, 17 Jul 2018 12:31:54 +0000 (12:31 +0000)]
[NFC][testcases] add testcases for folding srem whose operands are negatived.

Finish same optimization for add instruction in D49216 and sdiv instruction in
D49382. This patch is for srem instruction.

llvm-svn: 337270

6 years agoDon't assert that a size_t fits into 64bit.
Joerg Sonnenberger [Tue, 17 Jul 2018 12:30:34 +0000 (12:30 +0000)]
Don't assert that a size_t fits into 64bit.

Avoids tautological compare warnings on 32bit platforms.

llvm-svn: 337269

6 years ago[ELF] - Add test for checking unknown -color-diagnostics arguments.
George Rimar [Tue, 17 Jul 2018 12:14:48 +0000 (12:14 +0000)]
[ELF] - Add test for checking unknown -color-diagnostics arguments.

This covers a following line with the test:
https://github.com/llvm-mirror/lld/blob/master/ELF/DriverUtils.cpp#L73

llvm-svn: 337268

6 years ago[ASTImporter] Fix import of unnamed structs
Gabor Marton [Tue, 17 Jul 2018 12:06:36 +0000 (12:06 +0000)]
[ASTImporter] Fix import of unnamed structs

Summary:
D48773 simplified ASTImporter nicely, but it introduced a new error: Unnamed
structs are not imported correctly, if they appear in a recursive context.
This patch provides a fix for structural equivalency.

Reviewers: a.sidorin, a_sidorin, balazske, gerazo

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 337267

6 years ago[ELF] - Add a test for --no-warn-symbol-ordering.
George Rimar [Tue, 17 Jul 2018 12:04:23 +0000 (12:04 +0000)]
[ELF] - Add a test for --no-warn-symbol-ordering.

Mentioned flag was never tested together with
--call-graph-ordering-file. And the following line
was uncovered:

https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L248

llvm-svn: 337266

6 years ago[ELF] - Simplify Symbol::getSize(). NFC.
George Rimar [Tue, 17 Jul 2018 11:35:28 +0000 (11:35 +0000)]
[ELF] - Simplify Symbol::getSize(). NFC.

There are following symbols currently available:
DefinedKind, SharedKind, UndefinedKind, LazyArchiveKind, LazyObjectKind.

Our code calls getSize() only for first two and there
seems to be no reason to return 0 for the rest.

llvm-svn: 337265

6 years ago[LLVM-C] Fix name mangling on AggressiveInstCombine
whitequark [Tue, 17 Jul 2018 11:13:58 +0000 (11:13 +0000)]
[LLVM-C] Fix name mangling on AggressiveInstCombine

Similarly to rL336736, at least one more C API function does not
properly get declared as extern "C" due to a missing header, causing
name mangling and linking errors.

This patch fixes calls to LLVMAddAggressiveInstCombinerPass().

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

Reviewed By: whitequark

llvm-svn: 337264

6 years ago[LLVM-C] Add target triple normalization to the C API.
whitequark [Tue, 17 Jul 2018 10:57:39 +0000 (10:57 +0000)]
[LLVM-C] Add target triple normalization to the C API.

rL333307 was introduced to remove automatic target triple
normalization when calling sys::getDefaultTargetTriple(), arguing
that users of the latter already called Triple::normalize()
if necessary. However, users of the C API currently have no way of
doing target triple normalization.

This patch introduces an LLVMNormalizeTargetTriple function to
the C API which wraps Triple::normalize() and can be used on
the result of LLVMGetDefaultTargetTriple to achieve the same effect.

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

Reviewed By: whitequark

llvm-svn: 337263

6 years ago[llvm-objcopy] Run not with any python, but the python configured in lit.
Benjamin Kramer [Tue, 17 Jul 2018 10:30:56 +0000 (10:30 +0000)]
[llvm-objcopy] Run not with any python, but the python configured in lit.

llvm-svn: 337262

6 years agoMove pretty stack trace printer into driver.
Jonas Devlieghere [Tue, 17 Jul 2018 10:04:19 +0000 (10:04 +0000)]
Move pretty stack trace printer into driver.

We used to have a pretty stack trace printer in SystemInitializerCommon.
This was disabled on Apple because we didn't want the library to be
setting signal handlers, as this was causing issues when loaded into
Xcode. However, I think it's useful to have this for the LLDB driver, so
I moved it up to use the PrettyStackTraceProgram in the driver's main.

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

llvm-svn: 337261

6 years ago[ASTImporter] Import described template (if any) of function.
Balazs Keri [Tue, 17 Jul 2018 09:52:41 +0000 (09:52 +0000)]
[ASTImporter] Import described template (if any) of function.

Summary:
When a function is imported, check if it has a described template.
The name lookup is corrected to find the templated entity in this case.
The described template of the function is imported too.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 337260

6 years ago[AArch64][SVE] Asm: Support for predicated FP operations.
Sander de Smalen [Tue, 17 Jul 2018 09:48:57 +0000 (09:48 +0000)]
[AArch64][SVE] Asm: Support for predicated FP operations.

This patch adds support for the following floating point
instructions:
  FABD   (absolute difference)
  FADD   (addition)
  FSUB   (subtract)
  FSUBR  (subtract reverse form)
  FDIV   (divide)
  FDIVR  (divide reverse form)
  FMAX   (maximum)
  FMAXNM (maximum number)
  FMIN   (minimum)
  FMINNM (minimum number)
  FSCALE (adjust exponent)
  FMULX  (multiply extended)

All operations are predicated and binary form, e.g.

  fadd z0.h, p0/m, z0.h, z1.h
        ^___________^ (tied)

Supporting 16, 32 and 64-bit FP elements.

llvm-svn: 337259

6 years ago[DAGCombiner] Call SimplifyDemandedVectorElts from EXTRACT_VECTOR_ELT
Simon Pilgrim [Tue, 17 Jul 2018 09:45:35 +0000 (09:45 +0000)]
[DAGCombiner] Call SimplifyDemandedVectorElts from EXTRACT_VECTOR_ELT

If we are only extracting vector elements via EXTRACT_VECTOR_ELT(s) we may be able to use SimplifyDemandedVectorElts to avoid unnecessary vector ops.

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

llvm-svn: 337258

6 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Tue, 17 Jul 2018 09:39:55 +0000 (09:39 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

llvm-svn: 337257