platform/upstream/llvm.git
6 years ago[NFC] fix trivial typos in documents
Hiroshi Inoue [Fri, 15 Jun 2018 05:10:09 +0000 (05:10 +0000)]
[NFC] fix trivial typos in documents

llvm-svn: 334799

6 years ago[X86] Fix some checks to use X86 instead of X32.
Craig Topper [Fri, 15 Jun 2018 04:42:55 +0000 (04:42 +0000)]
[X86] Fix some checks to use X86 instead of X32.

These tests were recently updated so it looks like gone wrong.

llvm-svn: 334786

6 years ago[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.
Craig Topper [Fri, 15 Jun 2018 04:42:54 +0000 (04:42 +0000)]
[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.

llvm-svn: 334785

6 years agoAdd support for PLATFORM_*SIMULATOR
Frederic Riss [Fri, 15 Jun 2018 02:50:45 +0000 (02:50 +0000)]
Add support for PLATFORM_*SIMULATOR

The toolchain in Xcode 10 uses a new LC_BUILD_VERSION entry to identify
simulator binaries. Add support for reading those to debugserver.

The exisitng test testing that code is currently failling when run
with Xcode 10, no need for a new test.

llvm-svn: 334784

6 years agoChange TestExec.py from creating an i386+x86_64 fat binary
Jason Molenda [Fri, 15 Jun 2018 00:55:53 +0000 (00:55 +0000)]
Change TestExec.py from creating an i386+x86_64 fat binary
on darwin systems and re-execing itself, to creating two
separate test programs; lldb runs the first program and it
exec's the second.

Support for compiling for i386 is going away.

llvm-svn: 334783

6 years agoAdd debug info for OProfile profiling support
Andrew Kaylor [Fri, 15 Jun 2018 00:07:28 +0000 (00:07 +0000)]
Add debug info for OProfile profiling support

Patch by Gaetano Priori

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

llvm-svn: 334782

6 years ago[cmake] Change ON/OFF to YES/NO. NFC
Shoaib Meenai [Thu, 14 Jun 2018 23:40:04 +0000 (23:40 +0000)]
[cmake] Change ON/OFF to YES/NO. NFC

compnerd pointed out that the latter reads better over here.

llvm-svn: 334781

6 years ago[cmake] Add linker detection for Apple platforms
Shoaib Meenai [Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)]
[cmake] Add linker detection for Apple platforms

LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since `ld64.lld -v` doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

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

llvm-svn: 334780

6 years ago[compiler-rt] [builtins] Don't build __atomic_* by default.
Eli Friedman [Thu, 14 Jun 2018 23:22:53 +0000 (23:22 +0000)]
[compiler-rt] [builtins] Don't build __atomic_* by default.

The locks need to be implemented in a shared library to work correctly,
so they shouldn't be part of libclang_rt.builtins.a, except in
specialized scenarios where the user can prove it will only be linked
once.

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

llvm-svn: 334779

6 years agoModules: Fix implicit output file for .cppm to .pcm instead of stdout
David Blaikie [Thu, 14 Jun 2018 23:09:06 +0000 (23:09 +0000)]
Modules: Fix implicit output file for .cppm to .pcm instead of stdout

This code was introduced back in r178148, a change to introduce
-module-file-info - which still exists & seems like it's still tested (&
this change didn't cause any of those tests to fail).

It doesn't look like this change was necessary there - since it's about
pcm output, whereas -module-file-info looks like it's for pcm /input/.
So I'm not really sure what the original motivation was.

I'm open to ideas though, if it turns out the original change was
necessary/useful.

llvm-svn: 334778

6 years agoMake uitofp and sitofp defined on overflow.
Eli Friedman [Thu, 14 Jun 2018 22:58:48 +0000 (22:58 +0000)]
Make uitofp and sitofp defined on overflow.

IEEE 754 defines the expected result on overflow. As far as I know,
hardware implementations (of f16), and compiler-rt (__floatuntisf)
correctly return +-Inf on overflow. And I can't think of any useful
transform that would take advantage of overflow being undefined here.

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

llvm-svn: 334777

6 years ago[libFuzzer] [NFC] XFAIL one of the tests on iOS.
George Karpenkov [Thu, 14 Jun 2018 22:18:18 +0000 (22:18 +0000)]
[libFuzzer] [NFC] XFAIL one of the tests on iOS.

llvm-svn: 334775

6 years ago[libFuzzer] [NFC] Remaining minor fixes to support testing on devices.
George Karpenkov [Thu, 14 Jun 2018 22:13:36 +0000 (22:13 +0000)]
[libFuzzer] [NFC] Remaining minor fixes to support testing on devices.

XFAIL's and adding %run commands.

llvm-svn: 334774

6 years ago[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and...
Craig Topper [Thu, 14 Jun 2018 22:02:35 +0000 (22:02 +0000)]
[X86] Rename __builtin_ia32_pslldqi128 to __builtin_ia32_pslldqi128_byteshift and similar for other sizes. Remove the multiply by 8 from the header files.

The previous names took the shift amount in bits to match gcc and required a multiply by 8 in the header. This creates a misleading error message when we check the range of the immediate to the builtin since the allowed range also got multiplied by 8.

This commit changes the builtins to use a byte shift amount to match the underlying instruction and the Intel intrinsic.

Fixes the remaining issue from PR37795.

llvm-svn: 334773

6 years agoAdd an entitlement to debugserver
Frederic Riss [Thu, 14 Jun 2018 21:17:59 +0000 (21:17 +0000)]
Add an entitlement to debugserver

On macOS 10.14, debugserver needs to have an entitlement do be
allowed to debug processes. Adding this to both the Xcode and
cmake build system. This shouldn't have any impact on previous
OSs.

llvm-svn: 334772

6 years ago[ORC] Strip weak flags from a symbol once it is selected for materialization.
Lang Hames [Thu, 14 Jun 2018 21:16:29 +0000 (21:16 +0000)]
[ORC] Strip weak flags from a symbol once it is selected for materialization.

Once a symbol has been selected for materialization it can no longer be
overridden. Stripping the weak flag guarantees this (override attempts will
then be treated as duplicate definitions and result in a DuplicateDefinition
error).

llvm-svn: 334771

6 years ago[llvm-mca] Clean up the header comment. NFC.
Matt Davis [Thu, 14 Jun 2018 20:58:54 +0000 (20:58 +0000)]
[llvm-mca] Clean up the header comment. NFC.

This change removes a few dashes to make room for the header syntax string.

llvm-svn: 334770

6 years agoeasing the constraint for isNegatibleForFree and GetNegatedExpression
Michael Berg [Thu, 14 Jun 2018 20:54:13 +0000 (20:54 +0000)]
easing the constraint for isNegatibleForFree and GetNegatedExpression

Summary:
Here we relax the old constraint which utilized unsafe with the TargetOption flag HonorSignDependentRoundingFPMathOption, with the assertion that unsafe is no longer needed or never was required for correctness on FDIV/FMUL.

Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar

Reviewed By: spatel

Subscribers: efriedma, wdng, tpr

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

llvm-svn: 334769

6 years ago[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing
George Karpenkov [Thu, 14 Jun 2018 20:46:07 +0000 (20:46 +0000)]
[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing

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

llvm-svn: 334768

6 years agoRevert r334764, as it breaks some bots
Florian Hahn [Thu, 14 Jun 2018 20:32:58 +0000 (20:32 +0000)]
Revert r334764, as it breaks some bots

llvm-svn: 334767

6 years ago[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.
George Karpenkov [Thu, 14 Jun 2018 20:30:04 +0000 (20:30 +0000)]
[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.

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

llvm-svn: 334766

6 years ago[NFC] Generalize flags for linking in shared objects in compiler-rt tests to support...
George Karpenkov [Thu, 14 Jun 2018 20:29:47 +0000 (20:29 +0000)]
[NFC] Generalize flags for linking in shared objects in compiler-rt tests to support using multiple shared objects at once

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

llvm-svn: 334765

6 years ago[TableGen] Make TreePatternNode::getChild return a reference (NFC)
Florian Hahn [Thu, 14 Jun 2018 20:23:48 +0000 (20:23 +0000)]
[TableGen] Make TreePatternNode::getChild return a reference (NFC)

The return value of TreePatternNode::getChild is never null. This patch also
updates various places that use return values of getChild to also use
references. Those changes were suggested post-commit for D47463.

llvm-svn: 334764

6 years ago[c++17] If a class inherits virtual functions from a base class, it is
Richard Smith [Thu, 14 Jun 2018 20:03:22 +0000 (20:03 +0000)]
[c++17] If a class inherits virtual functions from a base class, it is
not an aggregtae.

llvm-svn: 334763

6 years agoFix wasm responsefile lld test on Windows
Reid Kleckner [Thu, 14 Jun 2018 19:59:22 +0000 (19:59 +0000)]
Fix wasm responsefile lld test on Windows

llvm-svn: 334762

6 years ago[COFF] Fix /wholearchive: to do libpath search again
Reid Kleckner [Thu, 14 Jun 2018 19:56:03 +0000 (19:56 +0000)]
[COFF] Fix /wholearchive: to do libpath search again

Fixes https://crbug.com/852882

llvm-svn: 334761

6 years ago[MSSA] Print more optimization information
George Burgess IV [Thu, 14 Jun 2018 19:55:53 +0000 (19:55 +0000)]
[MSSA] Print more optimization information

In particular, when asked to print a MemoryAccess, we'll now print where
defs are optimized to, and we'll print optimized access types.

This patch also introduces an operator<< to make printing AliasResults
easier.

Patch by Juneyoung Lee!

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

llvm-svn: 334760

6 years ago[x86] be more selective about converting 'and' to shuffle (PR37749)
Sanjay Patel [Thu, 14 Jun 2018 19:55:02 +0000 (19:55 +0000)]
[x86] be more selective about converting 'and' to shuffle (PR37749)

isVectorClearMaskLegal() is the TLI hook used by the generic
DAGCombiner::XformToShuffleWithZero().

We've grown to accomodate/expect this transform to shuffle
(disabling it more generally results in many regressions).
So I'm narrowly excluding the 256-bit types that clearly
are not worthwhile for AVX1.

I think in most cases we are able to recover by converting
the shuffle back into 'and' ops, but the cases in:
https://bugs.llvm.org/show_bug.cgi?id=37749
...show that there are cracks.

llvm-svn: 334759

6 years ago[X86] Fix stale comment in folding tables.
Craig Topper [Thu, 14 Jun 2018 19:28:31 +0000 (19:28 +0000)]
[X86] Fix stale comment in folding tables.

llvm-svn: 334758

6 years agoAMDGPU/GlobalISel: Implement select() for @llvm.amdgcn.cvt.pkrtz
Tom Stellard [Thu, 14 Jun 2018 19:26:37 +0000 (19:26 +0000)]
AMDGPU/GlobalISel: Implement select() for @llvm.amdgcn.cvt.pkrtz

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 334757

6 years agoRe-apply "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"
Justin Bogner [Thu, 14 Jun 2018 19:24:03 +0000 (19:24 +0000)]
Re-apply "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"

This is r334750 (which was reverted in r334754) with a fix for an
uninitialized variable that was caught by msan.

Original commit message:
> If a copy bundle happens to involve overlapping registers, we can end
> up with emitting the copies in an order that ends up clobbering some
> of the subregisters. Since instructions in the copy bundle
> semantically happen at the same time, this is incorrect and we need to
> make sure we order the copies such that this doesn't happen.

llvm-svn: 334756

6 years agoOne ShortFract ought to be enough for everyone.
Benjamin Kramer [Thu, 14 Jun 2018 19:20:48 +0000 (19:20 +0000)]
One ShortFract ought to be enough for everyone.

llvm-svn: 334755

6 years agoRevert "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"
Justin Bogner [Thu, 14 Jun 2018 19:10:57 +0000 (19:10 +0000)]
Revert "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"

There's an msan failure:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19549

This reverts r334750.

llvm-svn: 334754

6 years agoupdating isNegatibleForFree and GetNegatedExpression with fmf for fadd
Michael Berg [Thu, 14 Jun 2018 18:48:31 +0000 (18:48 +0000)]
updating isNegatibleForFree and GetNegatedExpression with fmf for fadd

Summary:  A FMF constraint is added to FADD with unsafe still available as the fallback

Reviewers: spatel, wristow, arsenm, hfinkel

Reviewed By: spatel

Subscribers: wdng

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

llvm-svn: 334753

6 years ago[WebAssembly] Ignore explicit section names for functions
Sam Clegg [Thu, 14 Jun 2018 18:48:19 +0000 (18:48 +0000)]
[WebAssembly] Ignore explicit section names for functions

WebAssembly doesn't support more than one function per section
and we rely on function sections being unique. This change ignores
the section provided by the function to avoid two functions being
in the same section.

Without this change the object writer produces the following
error for this test:
 LLVM ERROR: section already has a defining function: baz

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

llvm-svn: 334752

6 years ago[X86] Add inline assembly versions of _InterlockedExchange_HLEAcquire/Release and...
Craig Topper [Thu, 14 Jun 2018 18:43:52 +0000 (18:43 +0000)]
[X86] Add inline assembly versions of _InterlockedExchange_HLEAcquire/Release and _InterlockedCompareExchange_HLEAcquire/Release for MSVC compatibility.

Clang/LLVM doesn't have a way to pass an HLE hint through to the X86 backend to emit HLE prefixed instructions. So this is a good short term fix.

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

llvm-svn: 334751

6 years ago[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles
Justin Bogner [Thu, 14 Jun 2018 18:32:55 +0000 (18:32 +0000)]
[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles

If a copy bundle happens to involve overlapping registers, we can end
up with emitting the copies in an order that ends up clobbering some
of the subregisters. Since instructions in the copy bundle
semantically happen at the same time, this is incorrect and we need to
make sure we order the copies such that this doesn't happen.

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

llvm-svn: 334750

6 years ago[MSan] Linker-initialize static fallback_mutex in msan_allocator.cc
Alex Shlyapnikov [Thu, 14 Jun 2018 18:30:51 +0000 (18:30 +0000)]
[MSan] Linker-initialize static fallback_mutex in msan_allocator.cc

Summary:
static fallback_mutex in msan_allocator.cc does not need the ctor
call and can be linker initialized.

Issue: https://github.com/google/sanitizers/issues/194

Reviewers: morehouse, eugenis

Subscribers: delcypher, #sanitizers, llvm-commits

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

llvm-svn: 334749

6 years ago[ASan] Linker-initialize static ScopedInErrorReport::current_error_.
Alex Shlyapnikov [Thu, 14 Jun 2018 18:22:23 +0000 (18:22 +0000)]
[ASan] Linker-initialize static ScopedInErrorReport::current_error_.

Summary:
Static ScopedInErrorReport::current_error_ can be linker initialized to
shave one global ctor call on application startup and be __asan_init-safe.

Global constructors in ASan runtime are bad because __asan_init runs
from preinit_array, before any such constructors.

Issue: https://github.com/google/sanitizers/issues/194

Reviewers: eugenis, morehouse

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 334748

6 years ago[CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
Bruno Cardoso Lopes [Thu, 14 Jun 2018 18:20:04 +0000 (18:20 +0000)]
[CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2

On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.

Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.

rdar://problem/41103601

llvm-svn: 334747

6 years ago[CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
Bruno Cardoso Lopes [Thu, 14 Jun 2018 18:19:54 +0000 (18:19 +0000)]
[CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2

On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.

Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.

rdar://problem/41103601

llvm-svn: 334746

6 years agoAdd remaining fixed-point types and saturated equivalents to fix -Wswitch of r334718
Fangrui Song [Thu, 14 Jun 2018 18:19:40 +0000 (18:19 +0000)]
Add remaining fixed-point types and saturated equivalents to fix -Wswitch of r334718

llvm-svn: 334745

6 years ago[x86] add tests for AVX1 FP logic op abuse (PR37749); NFC
Sanjay Patel [Thu, 14 Jun 2018 18:08:06 +0000 (18:08 +0000)]
[x86] add tests for AVX1 FP logic op abuse (PR37749); NFC

Also, add a RUN for AVX2 to make sure that's good.

llvm-svn: 334744

6 years agoAdd a script to setup codesigning on macOS.
Frederic Riss [Thu, 14 Jun 2018 18:04:13 +0000 (18:04 +0000)]
Add a script to setup codesigning on macOS.

I've been using this script on a couple machines and it seems to work
so I'm putting it out there, maybe other people will find it useful.
It is strongly inspired from a similar script in the delve project.

llvm-svn: 334743

6 years ago[llvm-mca] Add tests for instructions that implicitly clear the upper portion of...
Andrea Di Biagio [Thu, 14 Jun 2018 17:48:42 +0000 (17:48 +0000)]
[llvm-mca] Add tests for instructions that implicitly clear the upper portion of a super-register.

On x86-64, a write to register EAX implicitly clears the upper half or RAX.
128-bit AVX instructions clear the upper 128-bit of the YMM register that
aliases the XMM definition register.

llvm-mca doesn't know about register writes that implicitly clear the upper
portion of an aliasing super-register. This issue will be fixed in a future patch.

llvm-svn: 334742

6 years ago[X86] Lowering Mask Scalar intrinsics to native IR (Clang part)
Tomasz Krupa [Thu, 14 Jun 2018 17:36:23 +0000 (17:36 +0000)]
[X86] Lowering Mask Scalar intrinsics to native IR (Clang part)

Summary: Lowering add, sub, mul, and div mask scalar intrinsic calls
to native IR.

Reviewers: craig.topper, RKSimon, spatel, sroland

Reviewed By: craig.topper

Subscribers: cfe-commits

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

llvm-svn: 334741

6 years ago[X86] Lowering Mask Scalar intrinsics to native IR (LLVM part)
Tomasz Krupa [Thu, 14 Jun 2018 17:32:58 +0000 (17:32 +0000)]
[X86] Lowering Mask Scalar intrinsics to native IR (LLVM part)

Summary: Complementary patch to lowering add, sub, mul and div mask scalar
intrinsics in Clang.

Reviewers: craig.topper, sroland, spatel, RKSimon

Reviewed by: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 334740

6 years ago[clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objectiv...
Ben Hamilton [Thu, 14 Jun 2018 17:30:10 +0000 (17:30 +0000)]
[clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objective-C ðŸ“œ

Contributed by @stephanemoore.

Reviewers: benhamilton, jolesiak, djasper

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits

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

llvm-svn: 334739

6 years ago[SCEV] Fix a variable name, NFC.
Justin Lebar [Thu, 14 Jun 2018 17:14:01 +0000 (17:14 +0000)]
[SCEV] Fix a variable name, NFC.

llvm-svn: 334738

6 years ago[SCEV] Simplify zext/trunc idiom that appears when handling bitmasks.
Justin Lebar [Thu, 14 Jun 2018 17:13:48 +0000 (17:13 +0000)]
[SCEV] Simplify zext/trunc idiom that appears when handling bitmasks.

Summary:
Specifically, we transform

  zext(2^K * (trunc X to iN)) to iM ->
  2^K * (zext(trunc X to i{N-K}) to iM)<nuw>

This is helpful because pulling the 2^K out of the zext allows further
optimizations.

Reviewers: sanjoy

Subscribers: hiraditya, llvm-commits, timshen

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

llvm-svn: 334737

6 years ago[SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances.
Justin Lebar [Thu, 14 Jun 2018 17:13:35 +0000 (17:13 +0000)]
[SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances.

Summary:
Previously we would do this simplification only if it did not introduce
any new truncs (excepting new truncs which replace other cast ops).

This change weakens this condition: If the number of truncs stays the
same, but we're able to transform trunc(X + Y) to X + trunc(Y), that's
still simpler, and it may open up additional transformations.

While we're here, also clean up some duplicated code.

Reviewers: sanjoy

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 334736

6 years ago[SCEV] Fix indentation and combine two if statements in getMulExpr, NFC.
Justin Lebar [Thu, 14 Jun 2018 17:13:22 +0000 (17:13 +0000)]
[SCEV] Fix indentation and combine two if statements in getMulExpr, NFC.

llvm-svn: 334735

6 years agoRevert "[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer."
Sam Clegg [Thu, 14 Jun 2018 17:11:19 +0000 (17:11 +0000)]
Revert "[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer."

This reverts rL331412.  We didn't up using fragment atoms
in the wasm object writer after all.

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

llvm-svn: 334734

6 years ago[AMDGPU] Document the AMDGPU LLVM attributes
Tony Tye [Thu, 14 Jun 2018 16:40:10 +0000 (16:40 +0000)]
[AMDGPU] Document the AMDGPU LLVM attributes

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

llvm-svn: 334733

6 years agoRevert rL334704: "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"
Bjorn Pettersson [Thu, 14 Jun 2018 16:08:22 +0000 (16:08 +0000)]
Revert rL334704: "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"

This reverts commit r334704.

Buildbots detected an assertion in "test tsan in debug compiler-rt build".

llvm-svn: 334732

6 years agoAvoid unused variable in non-assert builds.
Nirav Dave [Thu, 14 Jun 2018 15:55:15 +0000 (15:55 +0000)]
Avoid unused variable in non-assert builds.

llvm-svn: 334731

6 years ago[llvm-mca] Add another test for partial register stalls.
Andrea Di Biagio [Thu, 14 Jun 2018 15:54:34 +0000 (15:54 +0000)]
[llvm-mca] Add another test for partial register stalls.

This test checks that a physical register is correctly allocated for the partial
write to register BX.
The ADD instruction has to wait for the write to RBX (and BX) before being
executed.

llvm-svn: 334730

6 years ago[DAG] Avoid needing to walk out legalization tables. NFCI.
Nirav Dave [Thu, 14 Jun 2018 15:46:23 +0000 (15:46 +0000)]
[DAG] Avoid needing to walk out legalization tables. NFCI.

To avoid redundant work, during DAG legalization we keep tables
mapping pre-legalized SDValues to post-legalized SDValues and a
SDValue-to-SDValue map to enable fast node replacements. However, as
the keys are nodes which may be reused it is possible that an entry in
a table refers to a now deleted node N (that should have been renamed
by the value replacement map) while a new node N' exists. If N' is
then replaced that entry would be wrong. Previously we avoided this by
when potentially violating this property, walking every table and
updating all node pointers. This is very expensive but hopefully rare
occurance.

This patch assigns each instance of a SDValue used in legalization a
unique id and uses these ids in the legalization tables. This avoids
any such aliasing issue, avoiding the full table search and allowing
more aggressive incremental table pruning.

In some cases this is a 1000x speedup to compilation.

Reviewers: jyknight, echristo, bogner, tra

Reviewed By: bogner

Subscribers: dberris, grandinj, hiraditya, llvm-commits

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

llvm-svn: 334729

6 years ago[X86] Add more vector instructions to the memory folding table using the autogenerate...
Craig Topper [Thu, 14 Jun 2018 15:40:31 +0000 (15:40 +0000)]
[X86] Add more vector instructions to the memory folding table using the autogenerated table as a guide.

The test cahnge is because we now fold stack reload into RNDSCALE and RNDSCALE can be turned into ROUND by EVEX->VEX.

llvm-svn: 334728

6 years ago[X86] Remove '128' from the internal name of some scalar FP instructions to be consis...
Craig Topper [Thu, 14 Jun 2018 15:40:30 +0000 (15:40 +0000)]
[X86] Remove '128' from the internal name of some scalar FP instructions to be consistent with other scalar instructions.

llvm-svn: 334727

6 years ago[X86] Disable load unfolding for a bunch of instruction where unfolding would increas...
Craig Topper [Thu, 14 Jun 2018 15:40:29 +0000 (15:40 +0000)]
[X86] Disable load unfolding for a bunch of instruction where unfolding would increase the size of the load.

Found by an audit of the manual table vs the autogenerated table.

llvm-svn: 334726

6 years ago[X86] Remove NotMemoryFoldable from some AVX/AVX512 scalar instructions.
Craig Topper [Thu, 14 Jun 2018 15:40:27 +0000 (15:40 +0000)]
[X86] Remove NotMemoryFoldable from some AVX/AVX512 scalar instructions.

Some of these instructions are already in the manual folding table so we should have them in the auto table too.

llvm-svn: 334725

6 years ago[ORC] Filter out self-dependencies in VSO::addDependencies.
Lang Hames [Thu, 14 Jun 2018 15:32:59 +0000 (15:32 +0000)]
[ORC] Filter out self-dependencies in VSO::addDependencies.

llvm-svn: 334724

6 years ago[ORC] Assert that the query argument to VSO::lookup must be non-null.
Lang Hames [Thu, 14 Jun 2018 15:32:59 +0000 (15:32 +0000)]
[ORC] Assert that the query argument to VSO::lookup must be non-null.

llvm-svn: 334723

6 years ago[ORC] Add a WaitUntilReady argument to blockingLookup.
Lang Hames [Thu, 14 Jun 2018 15:32:58 +0000 (15:32 +0000)]
[ORC] Add a WaitUntilReady argument to blockingLookup.

If WaitUntilReady is set to true then blockingLookup will return once all
requested symbols are ready. If WaitUntilReady is set to false then
blockingLookup will return as soon as all requested symbols have been
resolved. In the latter case, if any error occurs in finalizing the symbols it
will be reported to the ExecutionSession, rather than returned by
blockingLookup.

llvm-svn: 334722

6 years ago[ORC] Strip the Materializing flag off finalized symbols in VSOs.
Lang Hames [Thu, 14 Jun 2018 15:32:56 +0000 (15:32 +0000)]
[ORC] Strip the Materializing flag off finalized symbols in VSOs.

Finalized symbols are no longer in the materializing state.

llvm-svn: 334721

6 years ago[docs] Update CompilerWriterInfo.rst for MIPS
Simon Dardis [Thu, 14 Jun 2018 15:16:37 +0000 (15:16 +0000)]
[docs] Update CompilerWriterInfo.rst for MIPS

Update the URL of where the documentation can be found.

llvm-svn: 334720

6 years ago[ASAN] fix typos and disable long-object-path test for win32
Peter Wu [Thu, 14 Jun 2018 15:12:46 +0000 (15:12 +0000)]
[ASAN] fix typos and disable long-object-path test for win32

Glob patterns seem unsupported for commands executed by the emulated
shell (LIT_USE_INTERNAL_SHELL=1). Disable the test while that is being
addressed (a workaround such as "cd a-*" also does not work).

llvm-svn: 334719

6 years ago[Fixed Point Arithmetic] Addition of the remaining fixed point types and their satura...
Leonard Chan [Thu, 14 Jun 2018 14:53:51 +0000 (14:53 +0000)]
[Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

This diff includes changes for the remaining _Fract and _Sat fixed point types.

```
signed short _Fract s_short_fract;
signed _Fract s_fract;
signed long _Fract s_long_fract;
unsigned short _Fract u_short_fract;
unsigned _Fract u_fract;
unsigned long _Fract u_long_fract;

// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;
short _Fract short_fract;
_Fract fract;
long _Fract long_fract;

// Saturated fixed point types
_Sat signed short _Accum sat_s_short_accum;
_Sat signed _Accum sat_s_accum;
_Sat signed long _Accum sat_s_long_accum;
_Sat unsigned short _Accum sat_u_short_accum;
_Sat unsigned _Accum sat_u_accum;
_Sat unsigned long _Accum sat_u_long_accum;
_Sat signed short _Fract sat_s_short_fract;
_Sat signed _Fract sat_s_fract;
_Sat signed long _Fract sat_s_long_fract;
_Sat unsigned short _Fract sat_u_short_fract;
_Sat unsigned _Fract sat_u_fract;
_Sat unsigned long _Fract sat_u_long_fract;

// Aliased saturated fixed point types
_Sat short _Accum sat_short_accum;
_Sat _Accum sat_accum;
_Sat long _Accum sat_long_accum;
_Sat short _Fract sat_short_fract;
_Sat _Fract sat_fract;
_Sat long _Fract sat_long_fract;
```

This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches.

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

llvm-svn: 334718

6 years agoDebugNamesDWARFIndex: fix handling of compressed sections
Pavel Labath [Thu, 14 Jun 2018 14:41:30 +0000 (14:41 +0000)]
DebugNamesDWARFIndex: fix handling of compressed sections

This fixes a silly bug where we were accidentally freeing the memory
used to store the decompressed .debug_names data. I had actually
considered this scenario when writing the class and put appropriate
precautions in place -- I just failed to wire it all up correctly.

This was only an issue for compressed sections because in case of
uncompressed ones we would access the data straight out of the mmapped
object file.

llvm-svn: 334717

6 years ago[scudo] Make Secondary linker-initialized compliant
Kostya Kortchinsky [Thu, 14 Jun 2018 14:33:28 +0000 (14:33 +0000)]
[scudo] Make Secondary linker-initialized compliant

Summary:
As a follow up to D48142 for Scudo, switch the `SpinMutex` to its static
counterpart, and ensure zero-initialization by memset'ing the whole class.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: delcypher, #sanitizers, llvm-commits

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

llvm-svn: 334716

6 years ago[EarlyCSE] Fix MSVC build. NFCI.
Simon Pilgrim [Thu, 14 Jun 2018 14:22:03 +0000 (14:22 +0000)]
[EarlyCSE] Fix MSVC build. NFCI.

MSVC doesn't let you assign different lambdas through a ternary operator.

llvm-svn: 334715

6 years ago[CostModel][AArch64] Add cost tests for ALTERNATE/SELECT style shuffle masks
Simon Pilgrim [Thu, 14 Jun 2018 14:20:20 +0000 (14:20 +0000)]
[CostModel][AArch64] Add cost tests for ALTERNATE/SELECT style shuffle masks

Precursor to fixing a regression with SLP vectorizer for supporting SELECT shuffles (vs the current ALTERNATE)

llvm-svn: 334714

6 years ago[MC] Move MCAssembler::dump into the correct cpp file. NFC
Sam Clegg [Thu, 14 Jun 2018 14:04:23 +0000 (14:04 +0000)]
[MC] Move MCAssembler::dump into the correct cpp file. NFC

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

llvm-svn: 334713

6 years ago[clangd] FuzzyMatch: forbid tail-tail matches after a miss: [pat] !~ "panther"
Sam McCall [Thu, 14 Jun 2018 13:50:30 +0000 (13:50 +0000)]
[clangd] FuzzyMatch: forbid tail-tail matches after a miss: [pat] !~ "panther"

Summary:
This is a small code change but vastly reduces noise in code completion results.
The intent of allowing this was to let [sc] ~ "strncpy" and [strcpy] ~ "strncpy"
however the benefits for unsegmented names aren't IMO worth the costs.

Test cases should be representative of the changes here.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 334712

6 years ago[clangd] Boost keyword completions.
Sam McCall [Thu, 14 Jun 2018 13:42:21 +0000 (13:42 +0000)]
[clangd] Boost keyword completions.

Summary: These have few signals other than being keywords, so the boost is high.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 334711

6 years ago[DWARFv5] Tolerate files not all having an MD5 checksum.
Paul Robinson [Thu, 14 Jun 2018 13:38:20 +0000 (13:38 +0000)]
[DWARFv5] Tolerate files not all having an MD5 checksum.

In some cases, for example when compiling a preprocessed file, the
front-end is not able to provide an MD5 checksum for all files. When
that happens, omit the MD5 checksums from the final DWARF, because
DWARF doesn't have a way to indicate that some but not all files have
a checksum.

When assembling a .s file, and some but not all .file directives
provide an MD5 checksum, issue a warning and don't emit MD5 into the
DWARF.

Fixes PR37623.

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

llvm-svn: 334710

6 years agoclang-format: Fix documentation generation
Francois Ferrand [Thu, 14 Jun 2018 13:32:14 +0000 (13:32 +0000)]
clang-format: Fix documentation generation

Summary:
It seems that the changes done to `ClangFormatStyleOptions.rst` @334408 are causing the generation of the documentation to fail, with the following error:

  Warning, treated as error:
    /llvm/tools/clang/docs/ClangFormatStyleOptions.rst:1060: WARNING: Definition list ends without a blank line; unexpected unindent.

This is due to missing indent in some code block, and fixed by this patch.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: cfe-commits

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

llvm-svn: 334709

6 years ago[mips] Correct predicates for MSA pseudo instructions
Simon Dardis [Thu, 14 Jun 2018 13:03:53 +0000 (13:03 +0000)]
[mips] Correct predicates for MSA pseudo instructions

llvm-svn: 334708

6 years ago[EarlyCSE] Propagate conditions of AND and OR instructions
Max Kazantsev [Thu, 14 Jun 2018 13:02:13 +0000 (13:02 +0000)]
[EarlyCSE] Propagate conditions of AND and OR instructions

This patches teaches EarlyCSE to figure out that if `and i1 %x, %y` is true then both
`%x` and `%y` are true in the taken branch, and if `or i1 %x, %y` is false then both
`%x` and `%y` are false in non-taken branch. Fix for PR37635.

Differential Revision: https://reviews.llvm.org/D47574
Reviewed By: reames

llvm-svn: 334707

6 years ago[TableGen] Move some shared_ptrs to avoid unnecessary copies (NFC).
Florian Hahn [Thu, 14 Jun 2018 11:56:19 +0000 (11:56 +0000)]
[TableGen] Move some shared_ptrs to avoid unnecessary copies (NFC).

Those changes were suggested post-commit for D47463.

llvm-svn: 334706

6 years ago[ELF][MIPS] Replace calls to MapVector::find by MapVector::lookup. NFC
Simon Atanasyan [Thu, 14 Jun 2018 11:53:31 +0000 (11:53 +0000)]
[ELF][MIPS] Replace calls to MapVector::find by MapVector::lookup. NFC

llvm-svn: 334705

6 years ago[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue
Bjorn Pettersson [Thu, 14 Jun 2018 11:23:42 +0000 (11:23 +0000)]
[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue

Summary:
Do not convert a DbgDeclare to DbgValue if the store
instruction only refer to a fragment of the variable
described by the DbgDeclare.

Problem was seen when for example having an alloca for an
array or struct, and there were stores to individual elements.
In the past we inserted a DbgValue intrinsics for each store,
just as if the store wrote the whole variable.

When handling store instructions we insert a DbgValue that
indicates that the variable is "undefined", as we do not know
which part of the variable that is updated by the store.

When ConvertDebugDeclareToDebugValue is used with a load/phi
instruction we assert that the referenced value is large enough
to cover the whole variable. Afaict this should be true for all
scenarios where those methods are used on trunk. If the assert
blows in the future I guess we could simply skip to insert a
dbg.value instruction.

In the future I think we should examine which part of the variable
that is accessed, and add a DbgValue instrinsic with an appropriate
DW_OP_LLVM_fragment expression.

Reviewers: dblaikie, aprantl, rnk

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits

Tags: #debug-info

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

llvm-svn: 334704

6 years ago[ASAN] fix startup crash in dlsym for long paths since glibc 2.27
Peter Wu [Thu, 14 Jun 2018 10:42:54 +0000 (10:42 +0000)]
[ASAN] fix startup crash in dlsym for long paths since glibc 2.27

Summary:
Error messages for dlsym used to be stored on the stack, but since
commit 2449ae7b ("ld.so: Introduce struct dl_exception") in glibc 2.27
these are now stored on the heap (and thus use the dlsym alloc pool).

Messages look like "undefined symbol: __isoc99_printf\0/path/to/a.out".
With many missing library functions and long object paths, the pool is
quickly exhausted. Implement a simple mechanism to return freed memory
to the pool (clear it in case it is used for calloc).

Fixes https://github.com/google/sanitizers/issues/957

Reviewed By: vitalybuka

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

llvm-svn: 334703

6 years agoFix PathMappingListTest on windows
Pavel Labath [Thu, 14 Jun 2018 10:31:06 +0000 (10:31 +0000)]
Fix PathMappingListTest on windows

r334615 changed the the value of FileSpec.IsRelative("/") for windows
path syntax. We previously considered it absolute but now it is
considered relative (I guess because it's interpretation depends on the
current drive).

This cause a failure in PathMappingList test, which assumed that "/"
will not get remapped as it is an absolute path. As this is no longer
true on windows, I replace "/" with a really absolute path.

llvm-svn: 334702

6 years ago[SLPVectorizer] Remove RawInstructionsData/getMainOpcode and merge into getSameOpcode
Simon Pilgrim [Thu, 14 Jun 2018 10:25:19 +0000 (10:25 +0000)]
[SLPVectorizer] Remove RawInstructionsData/getMainOpcode and merge into getSameOpcode

This is part of the work to cleanup use of 'alternate' ops so we can use the more general SK_Select shuffle type.

Only getSameOpcode calls getMainOpcode and much of the logic is repeated in both functions. This will require some reworking of D28907 but that patch has hit trouble and is unlikely to be completed anytime soon.

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

llvm-svn: 334701

6 years ago[OpenCL] Support new/delete in Sema
Sven van Haastregt [Thu, 14 Jun 2018 09:51:54 +0000 (09:51 +0000)]
[OpenCL] Support new/delete in Sema

Reject uses of the default new/delete operators with a diagnostic
instead of a crash in OpenCL C++ mode and accept user-defined forms.

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

llvm-svn: 334700

6 years ago[CostModel] Cleanup isSingleSourceVectorMask to match other shuffle matchers. NFCI.
Simon Pilgrim [Thu, 14 Jun 2018 09:48:19 +0000 (09:48 +0000)]
[CostModel] Cleanup isSingleSourceVectorMask to match other shuffle matchers. NFCI.

llvm-svn: 334699

6 years ago[CostModel] Recognise REVERSE shuffle mask if the elements come from the second src
Simon Pilgrim [Thu, 14 Jun 2018 09:35:00 +0000 (09:35 +0000)]
[CostModel] Recognise REVERSE shuffle mask if the elements come from the second src

llvm-svn: 334698

6 years agoFix includes in PlatformAppleSimulator.h
Pavel Labath [Thu, 14 Jun 2018 09:08:54 +0000 (09:08 +0000)]
Fix includes in PlatformAppleSimulator.h

This unbreaks the cmake build. Other plugins also use the include paths
starting with Plugins/..., so I am hoping this will work for the xcode build
too.

llvm-svn: 334697

6 years ago[AArch64] reverting rC334693 due to build failures
Luke Geeson [Thu, 14 Jun 2018 08:59:33 +0000 (08:59 +0000)]
[AArch64] reverting rC334693 due to build failures

llvm-svn: 334696

6 years agoSimplify the implementation of getCUDALibDeviceFunction. NFC.
Philip Pfaffe [Thu, 14 Jun 2018 08:54:55 +0000 (08:54 +0000)]
Simplify the implementation of getCUDALibDeviceFunction. NFC.

Summary:
The function is currently awfully complicated. Drop the IILE and use
StringRef over std::string.

Reviewers: Meinersbur, grosser, bollu

Reviewed By: Meinersbur

Subscribers: nemanjai, kbarton, bollu, llvm-commits, pollydev

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

llvm-svn: 334695

6 years agoRemoved trunk-Codegen directory added in error
Luke Geeson [Thu, 14 Jun 2018 08:51:52 +0000 (08:51 +0000)]
Removed trunk-Codegen directory added in error

llvm-svn: 334694

6 years ago[AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-A
Luke Geeson [Thu, 14 Jun 2018 08:28:56 +0000 (08:28 +0000)]
[AArch64] Added support for the vcvta_u16_f16 instrinsic for FP16 Armv8.2-A

llvm-svn: 334693

6 years ago[clang-format] Add SpaceBeforeCpp11BracedList option.
Hans Wennborg [Thu, 14 Jun 2018 08:01:09 +0000 (08:01 +0000)]
[clang-format] Add SpaceBeforeCpp11BracedList option.

WebKit C++ style for object initialization is as follows:

  Foo foo { bar };

Yet using clang-format -style=webkit changes this to:

  Foo foo{ bar };

As there is no existing combination of rules that will ensure a space
before a braced list in this fashion, this patch adds a new
SpaceBeforeCpp11BracedList rule.

Patch by Ross Kirsling!

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

llvm-svn: 334692

6 years ago[llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeName
Clement Courbet [Thu, 14 Jun 2018 06:57:52 +0000 (06:57 +0000)]
[llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeName

Summary:
Get rid of OpcodeName.

To remove the opcode name from an old file:
```
cat old_file | sed '/opcode_name.*/d'
```

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 334691

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Thu, 14 Jun 2018 05:41:49 +0000 (05:41 +0000)]
[NFC] fix trivial typos in comments

llvm-svn: 334687

6 years ago[Sanitizer] fix compilation warning
David Carlier [Thu, 14 Jun 2018 04:51:26 +0000 (04:51 +0000)]
[Sanitizer] fix compilation warning

In most of systems, this field is a signed type but in some it is an unsigned.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 334686

6 years ago[x86] fix mappings of cvttp2si/cvttp2ui x86 intrinsics to x86-specific nodes and...
Craig Topper [Thu, 14 Jun 2018 03:16:58 +0000 (03:16 +0000)]
[x86] fix mappings of cvttp2si/cvttp2ui x86 intrinsics to x86-specific nodes and isel patterns (PR37551)

Summary:
The tests in:
https://bugs.llvm.org/show_bug.cgi?id=37751
...show miscompiles because we wrongly mapped and folded x86-specific intrinsics into generic DAG nodes.

This patch corrects the mappings in X86IntrinsicsInfo.h and adds isel matching corresponding to the new patterns. The complete tests for the failure cases should be in avx-cvttp2si.ll and sse-cvttp2si.ll and avx512-cvttp2i.ll

Reviewers: RKSimon, gbedwell, spatel

Reviewed By: spatel

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 334685

6 years ago[analyzer] Re-enable C++17-specific RVO construction contexts.
Artem Dergachev [Thu, 14 Jun 2018 01:59:35 +0000 (01:59 +0000)]
[analyzer] Re-enable C++17-specific RVO construction contexts.

Not contexts themselves, but rather support for them in the analyzer.

Such construction contexts appear when C++17 mandatory copy elision occurs
while returning an object from a function, and presence of a destructor causes
a CXXBindTemporaryExpr to appear in the AST.

Additionally, such construction contexts may be chained, because a return-value
construction context doesn't really explain where the object is being returned
into, but only points to the parent stack frame, where the object may be
consumed by literally anything including another return statement. This
behavior is now modeled correctly by the analyzer as long as the object is not
returned beyond the boundaries of the analysis.

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

llvm-svn: 334684