platform/upstream/llvm.git
6 years agoUse fully qualified namespace name.
Zachary Turner [Thu, 11 Oct 2018 03:42:17 +0000 (03:42 +0000)]
Use fully qualified namespace name.

llvm::detail is not the only namespace named detail.  So if
someone has done a `using namespace llvm::support`, for example,
this will fail with an ambiguous namespace name.  Granted
people generally shouldn't be using large namespaces like that,
but it's common at local function scopes.

llvm-svn: 344216

6 years agoUse C++03 friendly version of alignof
Eric Fiselier [Thu, 11 Oct 2018 03:01:14 +0000 (03:01 +0000)]
Use C++03 friendly version of alignof

llvm-svn: 344215

6 years agoFix use of removed _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE
Eric Fiselier [Thu, 11 Oct 2018 01:48:00 +0000 (01:48 +0000)]
Fix use of removed _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE

It was replaced with the better named
_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE.

llvm-svn: 344214

6 years ago[hwasan] extend the stack-uar test
Kostya Serebryany [Thu, 11 Oct 2018 01:05:18 +0000 (01:05 +0000)]
[hwasan] extend the stack-uar test

llvm-svn: 344213

6 years agoEliminate dependency to formatv(). NFC.
Fangrui Song [Thu, 11 Oct 2018 00:58:00 +0000 (00:58 +0000)]
Eliminate dependency to formatv(). NFC.

llvm-svn: 344212

6 years ago[WebAssembly][NFC] Use intrinsic dag nodes directly
Thomas Lively [Thu, 11 Oct 2018 00:49:24 +0000 (00:49 +0000)]
[WebAssembly][NFC] Use intrinsic dag nodes directly

Summary: Instead of custom lowering to WebAssemblyISD nodes first.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344211

6 years ago[hwasan] more compact printing for 'Previosly allocated frames'
Kostya Serebryany [Thu, 11 Oct 2018 00:34:20 +0000 (00:34 +0000)]
[hwasan] more compact printing for 'Previosly allocated frames'

llvm-svn: 344210

6 years agoUpstreaming the BridgeOS device support and the
Jason Molenda [Thu, 11 Oct 2018 00:28:35 +0000 (00:28 +0000)]
Upstreaming the BridgeOS device support and the
LC_BUILD_VERSION load command handling - this
commit is a combination of patches by Adrian
Prantl and myself.  llvm::Triple::BridgeOS
isn't defined yet, so all references to that
are currently commented out.

Also update Xcode project file to build the
NativePDB etc plugins.

<rdar://problem/43353615>

llvm-svn: 344209

6 years agoUpdate libc++abi's detection of aligned allocation after r344207.
Eric Fiselier [Thu, 11 Oct 2018 00:18:54 +0000 (00:18 +0000)]
Update libc++abi's detection of aligned allocation after r344207.

llvm-svn: 344208

6 years agoDistinguish between library and language support for aligned allocation.
Eric Fiselier [Thu, 11 Oct 2018 00:17:24 +0000 (00:17 +0000)]
Distinguish between library and language support for aligned allocation.

There are two cases:
1. The library has all it needs to provide align_val_t and the
new/delete overloads needed to support aligned allocation.
2. The compiler has actually turned the language feature on.

There are times where libc++ needs to distinguish between the two.

This patch adds the additional macro
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION which denotes when case (1)
does not hold. _LIBCPP_HAS_NO_ALIGNED_ALLOCATION is defined whenever
_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION is defined, or when the
compiler has not enabled the language feature.

Additionally this patch cleans up a number of other macros related
to detection of aligned allocation machinery.

llvm-svn: 344207

6 years ago[MC][ELF] Fix section_mergeable_size.ll
Fangrui Song [Thu, 11 Oct 2018 00:08:59 +0000 (00:08 +0000)]
[MC][ELF] Fix section_mergeable_size.ll

Some targets use %progbits instead of @progbits.

Updating that check with a {{[@%]}}progbits regex to make those bots happy.

llvm-svn: 344206

6 years ago[WebAssembly] Saturating float-to-int builtins
Thomas Lively [Thu, 11 Oct 2018 00:07:55 +0000 (00:07 +0000)]
[WebAssembly] Saturating float-to-int builtins

Summary: Depends on D53007 and D53004.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits

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

llvm-svn: 344205

6 years ago[WebAssembly] Saturating float to int intrinsics
Thomas Lively [Thu, 11 Oct 2018 00:01:25 +0000 (00:01 +0000)]
[WebAssembly] Saturating float to int intrinsics

Summary:
Although the saturating float to int instructions are already
emitted from normal IR, the fpto{s,u}i instructions produce poison
values if the argument cannot fit in the result type. These intrinsics
are therefore necessary to get guaranteed defined saturating behavior.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344204

6 years ago[hwasan] simplify a test
Kostya Serebryany [Wed, 10 Oct 2018 23:57:38 +0000 (23:57 +0000)]
[hwasan] simplify a test

llvm-svn: 344203

6 years agollvm-c: Add C APIs to access DebugLoc info
Saleem Abdulrasool [Wed, 10 Oct 2018 23:53:12 +0000 (23:53 +0000)]
llvm-c: Add C APIs to access DebugLoc info

Add thin shims to C interface to provide access to DebugLoc info for
Instructions, GlobalVariables and Functions.  Patch by Josh Berdine!

llvm-svn: 344202

6 years agoUpdate documentation to indicate that profile remapping support is only
Richard Smith [Wed, 10 Oct 2018 23:33:18 +0000 (23:33 +0000)]
Update documentation to indicate that profile remapping support is only
implemented for the new pass manager so far.

llvm-svn: 344201

6 years agoAdd a flag to remap manglings when reading profile data information.
Richard Smith [Wed, 10 Oct 2018 23:13:47 +0000 (23:13 +0000)]
Add a flag to remap manglings when reading profile data information.

This can be used to preserve profiling information across codebase
changes that have widespread impact on mangled names, but across which
most profiling data should still be usable. For example, when switching
from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
or even from a 32-bit to a 64-bit build.

The user can provide a remapping file specifying parts of mangled names
that should be treated as equivalent (eg, std::__1 should be treated as
equivalent to std::__cxx11), and profile data will be treated as
applying to a particular function if its name is equivalent to the name
of a function in the profile data under the provided equivalences. See
the documentation change for a description of how this is configured.

Remapping is supported for both sample-based profiling and instruction
profiling. We do not support remapping indirect branch target
information, but all other profile data should be remapped
appropriately.

Support is only added for the new pass manager. If someone wants to also
add support for this for the old pass manager, doing so should be
straightforward.

This is the LLVM side of Clang r344199.

Reviewers: davidxl, tejohnson, dlj, erik.pilkington

Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 344200

6 years agoAdd a flag to remap manglings when reading profile data information.
Richard Smith [Wed, 10 Oct 2018 23:13:35 +0000 (23:13 +0000)]
Add a flag to remap manglings when reading profile data information.

This can be used to preserve profiling information across codebase
changes that have widespread impact on mangled names, but across which
most profiling data should still be usable. For example, when switching
from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
or even from a 32-bit to a 64-bit build.

The user can provide a remapping file specifying parts of mangled names
that should be treated as equivalent (eg, std::__1 should be treated as
equivalent to std::__cxx11), and profile data will be treated as
applying to a particular function if its name is equivalent to the name
of a function in the profile data under the provided equivalences. See
the documentation change for a description of how this is configured.

Remapping is supported for both sample-based profiling and instruction
profiling. We do not support remapping indirect branch target
information, but all other profile data should be remapped
appropriately.

Support is only added for the new pass manager. If someone wants to also
add support for this for the old pass manager, doing so should be
straightforward.

llvm-svn: 344199

6 years ago[LTO] Account for overriding lib calls via the alias attribute
Warren Ristow [Wed, 10 Oct 2018 22:54:31 +0000 (22:54 +0000)]
[LTO] Account for overriding lib calls via the alias attribute

Given a library call that is represented as an llvm intrinsic call, but
later transformed to an actual call, if an overriding definition of that
library routine is provided indirectly via an alias, prevent LTO from
eliminating the definition.

This is a fix for PR38547.

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

llvm-svn: 344198

6 years ago[MC][ELF] compute entity size for explicit sections
Nick Desaulniers [Wed, 10 Oct 2018 22:52:32 +0000 (22:52 +0000)]
[MC][ELF] compute entity size for explicit sections

Summary:
Global variables might declare themselves to be in explicit sections.
Calculate the entity size always to prevent assembler warnings
"entity size for SHF_MERGE not specified" when sections are to be
marked merge-able.

Fixes PR31828.

Reviewers: rnk, echristo

Reviewed By: rnk

Subscribers: llvm-commits, pirama, srhines

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

llvm-svn: 344197

6 years agoMake a member function private and rename it to avoid function overloading.
Rui Ueyama [Wed, 10 Oct 2018 22:49:29 +0000 (22:49 +0000)]
Make a member function private and rename it to avoid function overloading.

llvm-svn: 344196

6 years ago[ELF] Don't warn on undefined symbols if UnresolvedPolicy::Ignore is used
Fangrui Song [Wed, 10 Oct 2018 22:48:57 +0000 (22:48 +0000)]
[ELF] Don't warn on undefined symbols if UnresolvedPolicy::Ignore is used

Summary:
Add a condition UnresolvedPolicy::Ignore to elf::warnUnorderedSymbol to suppress Sym->isUndefined() warnings from both

1) --symbol-ordering-file=
2) .llvm.call-graph-profile

If --unresolved-symbols=ignore-all is used,

  no "undefined symbol" error/warning is emitted. It makes sense to not warn unorderable symbols.

Otherwise,

  If an executable is linked, the default policy UnresolvedPolicy::ErrorOrWarn will issue a "undefined symbol" error. The unorderable symbol warning is redundant.

  If a shared object is linked, it is possible that only part of object files are used and some symbols are left undefined. The warning is not very necessary.
    In particular for .llvm.call-graph-profile, when linking a shared object, a call graph profile may contain undefined symbols. This case generated a warning before but it will be suppressed by this patch.

Reviewers: ruiu, davidxl, espindola

Reviewed By: ruiu

Subscribers: grimar, emaste, arichardson, llvm-commits

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

llvm-svn: 344195

6 years agoUse TEST_STD_VER instead of __cplusplus [NFC]
Aaron Puchert [Wed, 10 Oct 2018 22:35:24 +0000 (22:35 +0000)]
Use TEST_STD_VER instead of __cplusplus [NFC]

While __cplusplus was only used a few dozen times, TEST_STD_VAR is used
more than 2000 times. So we replace the former by the latter for
consistency in the tests. There should be no functional change.

llvm-svn: 344194

6 years ago[hwasan] when reporting a bug, print some very basic information about the heap chunk...
Kostya Serebryany [Wed, 10 Oct 2018 22:24:44 +0000 (22:24 +0000)]
[hwasan] when reporting a bug, print some very basic information about the heap chunk (in addition to the more detailed info that we may fail to show)

llvm-svn: 344193

6 years agoUse std::scoped_lock only for C++17 and newer
Aaron Puchert [Wed, 10 Oct 2018 22:05:33 +0000 (22:05 +0000)]
Use std::scoped_lock only for C++17 and newer

This fixes a test failure caused by D53049.

llvm-svn: 344192

6 years ago[libcxxabi] Allow building with sanitizers enabled
Louis Dionne [Wed, 10 Oct 2018 22:00:58 +0000 (22:00 +0000)]
[libcxxabi] Allow building with sanitizers enabled

Summary:
I copied the sanitizer-related logic in libcxx/lib/CMakeLists.txt. In
the future, it would be great to avoid duplicating this logic in the
compiler, libc++ and libc++abi.

Reviewers: EricWF

Subscribers: mgorny, christof, dexonsmith, libcxx-commits, davide

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

llvm-svn: 344191

6 years ago[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals
Reid Kleckner [Wed, 10 Oct 2018 21:59:56 +0000 (21:59 +0000)]
[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals

Summary:
In r340386 we added code to give static locals in inline functions
default visibility. Instead, we should use the "default" visibility
passed on the command line, which could be hidden or protected, as GCC
does.

Some code bases use both -fvisibility=hidden and
-fvisibility-inlines-hidden to hide inline functions of classes that are
explicitly marked with default visibility.

Fixes PR39236

Reviewers: hans, thakis

Subscribers: eraman, llvm-commits

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

llvm-svn: 344190

6 years ago[X86] Prevent non-temporal loads from folding into instructions by blocking them...
Craig Topper [Wed, 10 Oct 2018 21:48:34 +0000 (21:48 +0000)]
[X86] Prevent non-temporal loads from folding into instructions by blocking them in X86DAGToDAGISel::IsProfitableToFold rather than with a predicate.

Remove tryFoldVecLoad since tryFoldLoad would call IsProfitableToFold and pick up the new check.

This saves about 5K out of ~600K on the generated isel table.

llvm-svn: 344189

6 years ago[CMake] NFC. Updating documentation on options
Chris Bieneman [Wed, 10 Oct 2018 21:36:12 +0000 (21:36 +0000)]
[CMake] NFC. Updating documentation on options

The Ninja pool options are only supported with the Ninja generator and
should be called out as such.

llvm-svn: 344188

6 years agoSupport for remapping profile data when symbols change, for sample-based
Richard Smith [Wed, 10 Oct 2018 21:31:01 +0000 (21:31 +0000)]
Support for remapping profile data when symbols change, for sample-based
profiling.

Reviewers: davidxl, tejohnson, dlj, erik.pilkington

Subscribers: llvm-commits

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

llvm-svn: 344187

6 years agoReplace most users of UnknownSize with LocationSize::unknown(); NFC
George Burgess IV [Wed, 10 Oct 2018 21:28:44 +0000 (21:28 +0000)]
Replace most users of UnknownSize with LocationSize::unknown(); NFC

Moving away from UnknownSize is part of the effort to migrate us to
LocationSizes (e.g. the cleanup promised in D44748).

This doesn't entirely remove all of the uses of UnknownSize; some uses
require tweaks to assume that UnknownSize isn't just some kind of int.
This patch is intended to just be a trivial replacement for all places
where LocationSize::unknown() will Just Work.

llvm-svn: 344186

6 years agoTest commit: fix typo in comment
Armando Montanez [Wed, 10 Oct 2018 21:16:57 +0000 (21:16 +0000)]
Test commit: fix typo in comment

llvm-svn: 344185

6 years agoSupport for remapping profile data when symbols change, for
Richard Smith [Wed, 10 Oct 2018 21:09:37 +0000 (21:09 +0000)]
Support for remapping profile data when symbols change, for
instrumentation-based profiling.

Reviewers: davidxl, tejohnson, dlj, erik.pilkington

Subscribers: llvm-commits

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

llvm-svn: 344184

6 years agollvm-ar: Darwin archive format fixes.
James Y Knight [Wed, 10 Oct 2018 21:07:02 +0000 (21:07 +0000)]
llvm-ar: Darwin archive format fixes.

* Support writing the DARWIN64 symbol table format.

* In darwin archives, emit a symbol table whenever requested, even
  when there are no members, as the apple linker will abort if given
  an archive without a symbol table.

Added tests for same, and also simplified and moved the GNU 64-bit
symbol table test into archive-symtab.test.

llvm-svn: 344183

6 years ago[NFC][X86][AArch64] extract-bits.ll: add tests with constants+storing results.
Roman Lebedev [Wed, 10 Oct 2018 20:50:52 +0000 (20:50 +0000)]
[NFC][X86][AArch64] extract-bits.ll: add tests with constants+storing results.

As noted in https://reviews.llvm.org/D53080#inline-467678,
this *may* get pessimized by that diff.

llvm-svn: 344182

6 years ago[InstCombine] reverse 'trunc X to <N x i1>' canonicalization; 2nd try
Sanjay Patel [Wed, 10 Oct 2018 20:47:46 +0000 (20:47 +0000)]
[InstCombine] reverse 'trunc X to <N x i1>' canonicalization; 2nd try

Re-trying r344082 because it unintentionally included extra diffs.

Original commit message:
icmp ne (and X, 1), 0 --> trunc X to N x i1

Ideally, we'd do the same for scalars, but there will likely be
regressions unless we add more trunc folds as we're doing here
for vectors.

The motivating vector case is from PR37549:
https://bugs.llvm.org/show_bug.cgi?id=37549

define <4 x float> @bitwise_select(<4 x float> %x, <4 x float> %y, <4 x float> %z, <4 x float> %w) {

  %c = fcmp ole <4 x float> %x, %y
  %s = sext <4 x i1> %c to <4 x i32>
  %s1 = shufflevector <4 x i32> %s, <4 x i32> undef, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
  %s2 = shufflevector <4 x i32> %s, <4 x i32> undef, <4 x i32> <i32 2, i32 2, i32 3, i32 3>
  %cond = or <4 x i32> %s1, %s2
  %condtr = trunc <4 x i32> %cond to <4 x i1>
  %r = select <4 x i1> %condtr, <4 x float> %z, <4 x float> %w
  ret <4 x float> %r

}

Here's a sampling of the vector codegen for that case using
mask+icmp (current behavior) vs. trunc (with this patch):

AVX before:

vcmpleps        %xmm1, %xmm0, %xmm0
vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
vorps   %xmm0, %xmm1, %xmm0
vandps  LCPI0_0(%rip), %xmm0, %xmm0
vxorps  %xmm1, %xmm1, %xmm1
vpcmpeqd        %xmm1, %xmm0, %xmm0
vblendvps       %xmm0, %xmm3, %xmm2, %xmm0

AVX after:

vcmpleps        %xmm1, %xmm0, %xmm0
vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
vorps   %xmm0, %xmm1, %xmm0
vblendvps       %xmm0, %xmm2, %xmm3, %xmm0

AVX512f before:

vcmpleps        %xmm1, %xmm0, %xmm0
vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
vorps   %xmm0, %xmm1, %xmm0
vpbroadcastd    LCPI0_0(%rip), %xmm1 ## xmm1 = [1,1,1,1]
vptestnmd       %zmm1, %zmm0, %k1
vblendmps       %zmm3, %zmm2, %zmm0 {%k1}

AVX512f after:

vcmpleps        %xmm1, %xmm0, %xmm0
vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
vorps   %xmm0, %xmm1, %xmm0
vpslld  $31, %xmm0, %xmm0
vptestmd        %zmm0, %zmm0, %k1
vblendmps       %zmm2, %zmm3, %zmm0 {%k1}

AArch64 before:

fcmge   v0.4s, v1.4s, v0.4s
zip1    v1.4s, v0.4s, v0.4s
zip2    v0.4s, v0.4s, v0.4s
orr     v0.16b, v1.16b, v0.16b
movi    v1.4s, #1
and     v0.16b, v0.16b, v1.16b
cmeq    v0.4s, v0.4s, #0
bsl     v0.16b, v3.16b, v2.16b

AArch64 after:

fcmge   v0.4s, v1.4s, v0.4s
zip1    v1.4s, v0.4s, v0.4s
zip2    v0.4s, v0.4s, v0.4s
orr     v0.16b, v1.16b, v0.16b
bsl     v0.16b, v2.16b, v3.16b

PowerPC-le before:

xvcmpgesp 34, 35, 34
vspltisw 0, 1
vmrglw 3, 2, 2
vmrghw 2, 2, 2
xxlor 0, 35, 34
xxlxor 35, 35, 35
xxland 34, 0, 32
vcmpequw 2, 2, 3
xxsel 34, 36, 37, 34

PowerPC-le after:

xvcmpgesp 34, 35, 34
vmrglw 3, 2, 2
vmrghw 2, 2, 2
xxlor 0, 35, 34
xxsel 34, 37, 36, 0

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

llvm-svn: 344181

6 years ago[WebAssembly][NFC] Remove repetition of Defs = [ARGUMENTS]
Thomas Lively [Wed, 10 Oct 2018 20:40:54 +0000 (20:40 +0000)]
[WebAssembly][NFC] Remove repetition of Defs = [ARGUMENTS]

Summary:
By moving that line into the `I` multiclass.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344180

6 years ago[X86] Move X86DAGToDAGISel::matchBEXTRFromAnd() into X86ISelLowering
Roman Lebedev [Wed, 10 Oct 2018 20:40:12 +0000 (20:40 +0000)]
[X86] Move X86DAGToDAGISel::matchBEXTRFromAnd() into X86ISelLowering

Summary:
As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=38938 | PR38938 ]],
we fail to emit `BEXTR` if the mask is shifted.
We can't deal with that in `X86DAGToDAGISel` `before the address mode for the inc is selected`,
and we can't really do it in the normal DAGCombine, because we don't have generic `ISD::BitFieldExtract` node,
and if we simply turn the shifted mask into a normal mask + shift-left, it will be folded back.
So it would seem X86ISelLowering is the place to handle this.

This patch only moves the matchBEXTRFromAnd()
from X86DAGToDAGISel to X86ISelLowering.
It does not add support for the 'shifted mask' pattern.

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 344179

6 years agorevert r344082: [InstCombine] reverse 'trunc X to <N x i1>' canonicalization
Sanjay Patel [Wed, 10 Oct 2018 20:39:39 +0000 (20:39 +0000)]
revert r344082: [InstCombine] reverse 'trunc X to <N x i1>' canonicalization

This commit accidentally included the diffs from D53057.

llvm-svn: 344178

6 years agoEliminate dependency to formatv(). NFC.
Rui Ueyama [Wed, 10 Oct 2018 20:29:29 +0000 (20:29 +0000)]
Eliminate dependency to formatv(). NFC.

llvm-svn: 344177

6 years ago[DwarfVerifier] Fixed -Wimplicit-fallthrough warning
David Bolvansky [Wed, 10 Oct 2018 20:10:37 +0000 (20:10 +0000)]
[DwarfVerifier] Fixed -Wimplicit-fallthrough warning

Reviewers: JDevlieghere, RKSimon

Reviewed By: JDevlieghere

Subscribers: llvm-commits

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

llvm-svn: 344176

6 years ago[WebAssembly][NFC] Use vnot patfrag to simplify v128.not
Thomas Lively [Wed, 10 Oct 2018 19:09:16 +0000 (19:09 +0000)]
[WebAssembly][NFC] Use vnot patfrag to simplify v128.not

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344175

6 years ago[hwasan] print all threads in a bug report
Kostya Serebryany [Wed, 10 Oct 2018 18:56:31 +0000 (18:56 +0000)]
[hwasan] print all threads in a bug report

llvm-svn: 344174

6 years ago[SymbolFileNativePDB] Fix compilation errors with gcc.
Zachary Turner [Wed, 10 Oct 2018 18:52:37 +0000 (18:52 +0000)]
[SymbolFileNativePDB] Fix compilation errors with gcc.

llvm-svn: 344173

6 years ago[LV] Add a new reduction pattern match
Renato Golin [Wed, 10 Oct 2018 18:49:49 +0000 (18:49 +0000)]
[LV] Add a new reduction pattern match

Adding a new reduction pattern match for vectorizing code similar to TSVC s3111:

for (int i = 0; i < N; i++)
  if (a[i] > b)
    sum += a[i];

This patch adds support for fadd, fsub and fmull, as well as multiple
branches and different (but compatible) instructions (ex. add+sub) in
different branches.

I have forwarded to trunk, added fsub and fmul functionality and
additional tests, but the credit goes to Takahiro, who did most of the
actual work.

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

Patch by Takahiro Miyoshi <takahiro.miyoshi@linaro.org>.

llvm-svn: 344172

6 years agoReland: [OptRemarks] Add library for parsing optimization remarks
Francis Visoiu Mistrih [Wed, 10 Oct 2018 18:43:42 +0000 (18:43 +0000)]
Reland: [OptRemarks] Add library for parsing optimization remarks

Add a library that parses optimization remarks (currently YAML, so based
on the YAMLParser).

The goal is to be able to provide tools a remark parser that is not
completely dependent on YAML, in case we decide to change the format
later.

It exposes a C API which takes a handler that is called with the remark
structure.

It adds a libLLVMOptRemark.a static library, and it's used in-tree by
the llvm-opt-report tool (from which the parser has been mostly moved
out).

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

Fixed the tests by removing the usage of C++11 strings, which seems not
to be supported by gcc 4.8.4 if they're used as a macro argument.

llvm-svn: 344171

6 years ago[hwasan] print more tags around the buggy address, and do it with a single Printf
Kostya Serebryany [Wed, 10 Oct 2018 18:32:31 +0000 (18:32 +0000)]
[hwasan] print more tags around the buggy address, and do it with a single Printf

llvm-svn: 344169

6 years ago[Windows] Fix a bug that causes lldb to freeze
Aaron Smith [Wed, 10 Oct 2018 18:30:32 +0000 (18:30 +0000)]
[Windows] Fix a bug that causes lldb to freeze

Summary:
If the process exits before any initial stop then notify the debugger
of the error otherwise WaitForDebuggerConnection() will be blocked.
An example of this issue is when a process fails to load a dependent DLL.

In addition to the fix, remove a duplicate call to FreeProcessHandles() in
DebuggerThread::HandleExitProcessEvent() and use decimal format
for all thread IDs.

Reviewers: rnk, zturner, aleksandr.urakov

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 344168

6 years agoAdd test macros for always_inline and noinline
Eric Fiselier [Wed, 10 Oct 2018 18:22:23 +0000 (18:22 +0000)]
Add test macros for always_inline and noinline

llvm-svn: 344167

6 years ago[Support] Remove redundant qualifiers in YAMLTraits (NFC)
Scott Linder [Wed, 10 Oct 2018 18:14:02 +0000 (18:14 +0000)]
[Support] Remove redundant qualifiers in YAMLTraits (NFC)

llvm-svn: 344166

6 years agoRevert "[OptRemarks] Add library for parsing optimization remarks"
Francis Visoiu Mistrih [Wed, 10 Oct 2018 18:07:44 +0000 (18:07 +0000)]
Revert "[OptRemarks] Add library for parsing optimization remarks"

This reverts commit 1cc98e6672b6319fdb00b70dd4474aabdadbe193.

Seems to break bots: http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/33398/steps/build-unified-tree/logs/stdio

llvm-svn: 344164

6 years ago[GlobalISel] Fix the artifact combiner to fold G_IMPLICIT_DEF properly
Volkan Keles [Wed, 10 Oct 2018 18:01:48 +0000 (18:01 +0000)]
[GlobalISel] Fix the artifact combiner to fold G_IMPLICIT_DEF properly

Summary:
GlobalISel generates incorrect code because the legalizer artifact
combiner assumes `G_[SZ]EXT (G_IMPLICIT_DEF)` is equivalent to
`G_IMPLICIT_DEF `.

Replace `G_[SZ]EXT (G_IMPLICIT_DEF)` with 0 because the top bits
will be 0 for G_ZEXT and 0/1 for the G_SEXT.

Reviewers: aditya_nandakumar, dsanders, aemerson, javed.absar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 344163

6 years ago[OptRemarks] Add library for parsing optimization remarks
Francis Visoiu Mistrih [Wed, 10 Oct 2018 17:58:09 +0000 (17:58 +0000)]
[OptRemarks] Add library for parsing optimization remarks

Add a library that parses optimization remarks (currently YAML, so based
on the YAMLParser).

The goal is to be able to provide tools a remark parser that is not
completely dependent on YAML, in case we decide to change the format
later.

It exposes a C API which takes a handler that is called with the remark
structure.

It adds a libLLVMOptRemark.a static library, and it's used in-tree by
the llvm-opt-report tool (from which the parser has been mostly moved
out).

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

llvm-svn: 344162

6 years ago[VPlan] Fix CondBit quoting in dumpBasicBlock
Renato Golin [Wed, 10 Oct 2018 17:55:21 +0000 (17:55 +0000)]
[VPlan] Fix CondBit quoting in dumpBasicBlock

Quotes were being printed for VPInstructions but not the rest.

llvm-svn: 344161

6 years agoFix linking filesystem benchmarks
Eric Fiselier [Wed, 10 Oct 2018 17:46:20 +0000 (17:46 +0000)]
Fix linking filesystem benchmarks

llvm-svn: 344160

6 years ago[clang] Fix failing attribute test on Windows
Louis Dionne [Wed, 10 Oct 2018 17:37:37 +0000 (17:37 +0000)]
[clang] Fix failing attribute test on Windows

The test added in r344146 was failing because the ABI on Windows is
different, and that test includes ABI-specific details. The test now
harcodes which ABI to use so we can rely on those details.

llvm-svn: 344159

6 years agoChange the timestamp of llvmcache-foo file to meet the thinLTO prune policy
Craig Topper [Wed, 10 Oct 2018 17:37:32 +0000 (17:37 +0000)]
Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy

The case will randomly fail if we test it with command "
while llvm-lit test/tools/gold/X86/cache.ll ; do true; done". It is because the llvmcache-foo file is younger than llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6. But due to timestamp precision reason their timestamp is the same. Given the same timestamp, the file prune policy is to remove bigger size file first, so mostly foo file is removed for its bigger size. And the files size is under threshold after deleting foo file. That's what test case expect.

However sometimes, the precision is enough to measure that timestamp of llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are smaller than foo, so llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are deleted first. Since the files size is still above the file size threshold after deleting the 2 files, the foo file is also deleted. And then the test case fails, because it expect only one file should be deleted instead of 3.

The fix is to change the timestamp of llvmcache-foo file to meet the thinLTO prune policy.

Patch by Luo Yuanke.

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

llvm-svn: 344158

6 years ago[Sema] Fix a multiple definition bug with friends and templates
Erik Pilkington [Wed, 10 Oct 2018 17:17:51 +0000 (17:17 +0000)]
[Sema] Fix a multiple definition bug with friends and templates

The problem was that MergeFunctionDecl sometimes needs the injected template
arguments of a FunctionTemplateDecl, but is called before adding the new
template to the redecl chain. This leads to multiple common pointers in the same
redecl chain, each with their own identical instantiation. Fix this by merging
the the common state before inserting the new template into the redecl chain.

rdar://44810129

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

llvm-svn: 344157

6 years agoBlind attempt to fix linker errors when building libc++abit w/o exceptions.
Marshall Clow [Wed, 10 Oct 2018 17:12:54 +0000 (17:12 +0000)]
Blind attempt to fix linker errors when building libc++abit w/o exceptions.

llvm-svn: 344156

6 years agoCreate a SymbolFile plugin for cross-platform PDB access.
Zachary Turner [Wed, 10 Oct 2018 16:39:07 +0000 (16:39 +0000)]
Create a SymbolFile plugin for cross-platform PDB access.

The existing SymbolFilePDB only works on Windows, as it is written
against a closed-source Microsoft SDK that ships with their debugging
tools.

There are several reasons we want to bypass this and go straight to the
bits of the PDB, but just to list a few:

More room for optimization. We can't see inside the implementation of
the Microsoft SDK, so we don't always know if we're doing things in the
most efficient way possible. For example, setting a breakpoint on main
of a big program currently takes several seconds. With the
implementation here, the time is unnoticeable.
We want to be able to symbolize Windows minidumps even if not on
Windows. Someone should be able to debug Windows minidumps as if they
were on Windows, given that no running process is necessary.
This patch is a very crude first attempt at filling out some of the
basic pieces.

I've implemented FindFunctions, ParseCompileUnitLineTable, and
ResolveSymbolContext for a limited subset of possible parameter values,
which is just enough to get it to display something nice for the
breakpoint location.

I've added several tests exercising this functionality which are limited
enough to work on all platforms but still exercise this functionality.
I'll try to add as many tests of this nature as I can, but at some
point we'll need a live process.

For now, this plugin is enabled always on non-Windows, and by setting
the environment variable LLDB_USE_NATIVE_PDB_READER=1 on Windows.
Eventually, once it's at parity with the Windows implementation, we'll
delete the Windows DIA-based implementation.

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

llvm-svn: 344154

6 years agoRelax trivial cast requirements in CallPromotionUtils
Scott Linder [Wed, 10 Oct 2018 16:35:47 +0000 (16:35 +0000)]
Relax trivial cast requirements in CallPromotionUtils

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

llvm-svn: 344153

6 years agoMake libc++abi work better with gcc's ARM unwind library. Reviewed as https://reviews...
Marshall Clow [Wed, 10 Oct 2018 16:18:37 +0000 (16:18 +0000)]
Make libc++abi work better with gcc's ARM unwind library. Reviewed as https://reviews.llvm.org/D42242

llvm-svn: 344152

6 years ago[llvm-exegesis] Fix always true assert
Guillaume Chatelet [Wed, 10 Oct 2018 16:16:43 +0000 (16:16 +0000)]
[llvm-exegesis] Fix always true assert

llvm-svn: 344151

6 years ago[CodeGenCXX] Treat 'this' as noalias in constructors
Anton Bikineev [Wed, 10 Oct 2018 16:14:51 +0000 (16:14 +0000)]
[CodeGenCXX] Treat 'this' as noalias in constructors

This is currently a clang extension and a resolution
of the defect report in the C++ Standard.

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

llvm-svn: 344150

6 years ago[llvm-mca] Minor refactoring in preparation for a patch that will fully fix PR36671...
Andrea Di Biagio [Wed, 10 Oct 2018 16:08:02 +0000 (16:08 +0000)]
[llvm-mca] Minor refactoring in preparation for a patch that will fully fix PR36671. NFCI

llvm-svn: 344149

6 years ago[OpenCL] Fixed address space cast in C style cast of C++ parsing
Anastasia Stulova [Wed, 10 Oct 2018 16:05:22 +0000 (16:05 +0000)]
[OpenCL] Fixed address space cast in C style cast of C++ parsing

C style cast in OpenCL C++ was ignoring the address space
conversions from OpenCL C and as a result accepting incorrect
code to compile. This commit adds special function for checking
correctness of address spaces that is shared between C and C++
casts.

llvm-svn: 344148

6 years ago[Hexagon] Use GetLinkerPath instead of hard-coded string.
Sid Manning [Wed, 10 Oct 2018 15:37:03 +0000 (15:37 +0000)]
[Hexagon] Use GetLinkerPath instead of hard-coded string.

Add GetLinkerPath and set the default to "hexagon-link".
Use GetLinkerPath instead of the hard-coded string.

This change will allow -fuse-ld to function correctly.

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

llvm-svn: 344147

6 years ago[clang] Properly apply attributes on explicit instantiations of static data members
Louis Dionne [Wed, 10 Oct 2018 15:32:29 +0000 (15:32 +0000)]
[clang] Properly apply attributes on explicit instantiations of static data members

Summary: https://llvm.org/PR39118

Reviewers: aaron.ballman, rnk

Subscribers: dexonsmith, cfe-commits

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

llvm-svn: 344146

6 years ago[llvm-exegesis][NFC] Pass Instruction instead of bare Opcode
Guillaume Chatelet [Wed, 10 Oct 2018 14:57:32 +0000 (14:57 +0000)]
[llvm-exegesis][NFC] Pass Instruction instead of bare Opcode

llvm-svn: 344145

6 years ago[llvm-mca][BtVer2] Add two more move-elimination tests. NFC
Andrea Di Biagio [Wed, 10 Oct 2018 14:46:54 +0000 (14:46 +0000)]
[llvm-mca][BtVer2] Add two more move-elimination tests. NFC

These should test all the optimizable moves on Jaguar.
A follow-up patch will teach how to recognize these optimizable register moves.

llvm-svn: 344144

6 years ago[llvm-exegesis][NFC] Code simplification
Guillaume Chatelet [Wed, 10 Oct 2018 14:22:48 +0000 (14:22 +0000)]
[llvm-exegesis][NFC] Code simplification

Summary: Simplify code by having LLVMState hold the RegisterAliasingTrackerCache.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344143

6 years ago[DAGCombine] Improve Load-Store Forwarding
Nirav Dave [Wed, 10 Oct 2018 14:15:52 +0000 (14:15 +0000)]
[DAGCombine] Improve Load-Store Forwarding

Summary:
Extend analysis forwarding loads from preceeding stores to work with
extended loads and truncated stores to the same address so long as the
load is fully subsumed by the store.

Hexagon's swp-epilog-phis.ll and swp-memrefs-epilog1.ll test are
deleted as they've no longer seem to be relevant.

Reviewers: RKSimon, rnk, kparzysz, javed.absar

Subscribers: sdardis, nemanjai, hiraditya, atanasyan, llvm-commits

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

llvm-svn: 344142

6 years ago[x86] allow single source horizontal op matching (PR39195)
Sanjay Patel [Wed, 10 Oct 2018 13:39:59 +0000 (13:39 +0000)]
[x86] allow single source horizontal op matching (PR39195)

This is intended to restore horizontal codegen to what it looked like before IR demanded elements improved in:
rL343727

As noted in PR39195:
https://bugs.llvm.org/show_bug.cgi?id=39195
...horizontal ops can be worse for performance than a shuffle+regular binop, so I've added a TODO. Ideally, we'd
solve that in a machine instruction pass, but a quicker solution will be adding a 'HasFastHorizontalOp' feature
bit to deal with it here in the DAG.

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

llvm-svn: 344141

6 years agoLift VFS from clang to llvm (NFC)
Jonas Devlieghere [Wed, 10 Oct 2018 13:27:25 +0000 (13:27 +0000)]
Lift VFS from clang to llvm (NFC)

This patch moves the virtual file system form clang to llvm so it can be
used by more projects.

Concretely the patch:
 - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support.
 - Moves the corresponding unit test from clang to llvm.
 - Moves the vfs namespace from clang::vfs to llvm::vfs.
 - Formats the lines affected by this change, mostly this is the result of
   the added llvm namespace.

RFC on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html

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

llvm-svn: 344140

6 years ago[llvm-exegesis] Fix function return generation so it doesn't return register 0
John Brawn [Wed, 10 Oct 2018 13:03:23 +0000 (13:03 +0000)]
[llvm-exegesis] Fix function return generation so it doesn't return register 0

When fillMachineFunction generates a return on targets without a return opcode
(such as AArch64) it should pass an empty set of registers as the return
registers, not 0 which means register number zero.

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

llvm-svn: 344139

6 years ago[TargetLowering] SimplifyDemandedBits - rename demanded mask args. NFCI.
Simon Pilgrim [Wed, 10 Oct 2018 13:00:49 +0000 (13:00 +0000)]
[TargetLowering] SimplifyDemandedBits - rename demanded mask args. NFCI.

Help stop bugs like rL343935 by making the 'original' DemandedBits arg more obviously not the mask that is actually used.

llvm-svn: 344138

6 years ago[llvm-exegesis][NFC] Fix typo
Guillaume Chatelet [Wed, 10 Oct 2018 12:58:40 +0000 (12:58 +0000)]
[llvm-exegesis][NFC] Fix typo

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344137

6 years ago[TargetLowering] SimplifyDemandedBits - pull out repeated getOperands. NFCI.
Simon Pilgrim [Wed, 10 Oct 2018 12:32:13 +0000 (12:32 +0000)]
[TargetLowering] SimplifyDemandedBits - pull out repeated getOperands. NFCI.

Part of a minor cleanup to make all the switch statements more consistent prior to improving vector support.

llvm-svn: 344136

6 years agoRevert "[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG."
Carlos Alberto Enciso [Wed, 10 Oct 2018 12:09:34 +0000 (12:09 +0000)]
Revert "[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG."

This reverts commit r344120.

It was causing buildbot failures.

llvm-svn: 344135

6 years ago[TableGen] fix assert in !cast when used out of definition in a multiclass
Valery Pykhtin [Wed, 10 Oct 2018 10:52:57 +0000 (10:52 +0000)]
[TableGen] fix assert in !cast when used out of definition in a multiclass

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

llvm-svn: 344134

6 years ago[CodeComplete] Fix crash when completing params function declarations.
Sam McCall [Wed, 10 Oct 2018 10:51:48 +0000 (10:51 +0000)]
[CodeComplete] Fix crash when completing params function declarations.

Summary:
In a decl like `int AA(BB cc)` where BB isn't defined, we end up trying to
parse `BB cc` as an expression (vexing parse) and end up triggering the
parser's "recovery-in-function" completion with no actual function
scope.

This patch avoids the assumption that such a scope exists in this context.

Reviewers: kadircet

Subscribers: cfe-commits

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

llvm-svn: 344133

6 years ago[TargetLowering] Add root node back to work list after successful SimplifyDemandedBit...
Simon Pilgrim [Wed, 10 Oct 2018 10:44:15 +0000 (10:44 +0000)]
[TargetLowering] Add root node back to work list after successful SimplifyDemandedBits/SimplifyDemandedVectorElts

Similar to what already happens in the DAGCombiner wrappers, this patch adds the root nodes back onto the worklist if the DCI wrappers' SimplifyDemandedBits/SimplifyDemandedVectorElts were successful.

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

llvm-svn: 344132

6 years ago[llvm-exegesis] Fix broken build.
Guillaume Chatelet [Wed, 10 Oct 2018 10:09:42 +0000 (10:09 +0000)]
[llvm-exegesis] Fix broken build.

llvm-svn: 344131

6 years ago[llvm-exegesis][NFC] Simplify code now that Instruction has more semantic
Guillaume Chatelet [Wed, 10 Oct 2018 09:45:17 +0000 (09:45 +0000)]
[llvm-exegesis][NFC] Simplify code now that Instruction has more semantic

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344130

6 years ago[SystemZ] Temporarily disable high VFs with integer div/rem.
Jonas Paulsson [Wed, 10 Oct 2018 09:30:29 +0000 (09:30 +0000)]
[SystemZ]  Temporarily disable high VFs with integer div/rem.

Until mischeduler is clever enough to avoid spilling in a vectorized loop
with many (scalar) DLRs it is better to avoid high vectorization factors (8
and above).

llvm-svn: 344129

6 years agoFix an ordering bug in the scalarizer.
Neil Henning [Wed, 10 Oct 2018 09:27:45 +0000 (09:27 +0000)]
Fix an ordering bug in the scalarizer.

I've added a new test case that causes the scalarizer to try and use
dead-and-erased values - caused by the basic blocks not being in
domination order within the function. To fix this, instead of iterating
through the blocks in function order, I walk them in reverse post order.

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

llvm-svn: 344128

6 years ago[llvm-exegesis] Remove unused variable, add more semantic to Instruction.
Guillaume Chatelet [Wed, 10 Oct 2018 09:12:36 +0000 (09:12 +0000)]
[llvm-exegesis] Remove unused variable, add more semantic to Instruction.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344127

6 years ago[sanitizers] [windows] Use a linker directive pragma for psapi
Martin Storsjo [Wed, 10 Oct 2018 09:03:58 +0000 (09:03 +0000)]
[sanitizers] [windows] Use a linker directive pragma for psapi

This allows users of static libraries (such as ubsan) to link without
knowing about this transitive dependency, if using the psapi functions
that require linking to a separate psapi library. Since Windows 7,
these functions (EnumProcessModules, GetModuleInformation,
GetProcessMemoryInfo) are remapped to K32- prefixed ones, available in
kernel32.dll.

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

llvm-svn: 344126

6 years ago[MinGW] Fix passing a sanitizer lib name as dependent lib
Martin Storsjo [Wed, 10 Oct 2018 09:01:00 +0000 (09:01 +0000)]
[MinGW] Fix passing a sanitizer lib name as dependent lib

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

llvm-svn: 344125

6 years ago[COFF] Look for libfoo.a if foo.lib is specified, for MinGW
Martin Storsjo [Wed, 10 Oct 2018 09:00:10 +0000 (09:00 +0000)]
[COFF] Look for libfoo.a if foo.lib is specified, for MinGW

This allows using #pragma comment(lib, "foo") in MinGW built code,
if built with -fms-extensions. (This works for system libraries and
static libraries only, as it doesn't try to look for .dll.a. As
ld.bfd doesn't support embedded defaultlib directives, this isn't
in widespread use among mingw users.)

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

llvm-svn: 344124

6 years ago[MinGW] Pass libpath to the COFF linker
Martin Storsjo [Wed, 10 Oct 2018 09:00:03 +0000 (09:00 +0000)]
[MinGW] Pass libpath to the COFF linker

This is necessary for handling defaultlib directives embedded in
object files, unless they use an absolute path.

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

llvm-svn: 344123

6 years ago[LLDB] - Simplify. NFC.
George Rimar [Wed, 10 Oct 2018 08:49:17 +0000 (08:49 +0000)]
[LLDB] - Simplify. NFC.

There are several places that call `FindRanges`,
all of them use `Slide` to adjust the ranges found
by the base address.
All except one, which does the same manually in a loop.
Patch updates it to use `Slide` for consistency.

llvm-svn: 344122

6 years agoPort llvm r342166 to libcxxabi demangler
Pavel Labath [Wed, 10 Oct 2018 08:39:16 +0000 (08:39 +0000)]
Port llvm r342166 to libcxxabi demangler

Summary:
This was committed back in september (D51463), but it seems it never
made it into the libcxxabi copy.

The original commit message was:
  The hash computed for an ArrayType was different when first constructed
  versus when later profiled due to the constructor default argument, and
  we were not tracking constructor / destructor variant as part of the
  mangled name AST, leading to incorrect equivalences.

Reviewers: erik.pilkington, rsmith, EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 344121

6 years ago[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG.
Carlos Alberto Enciso [Wed, 10 Oct 2018 08:29:55 +0000 (08:29 +0000)]
[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG.

When SimplifyCFG changes the PHI node into a select instruction, the debug line records becomes ambiguous. It causes the debugger to display unreachable source lines.

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

llvm-svn: 344120

6 years ago[LLDB] - Add basic support for .debug_rnglists section (DWARF5)
George Rimar [Wed, 10 Oct 2018 08:11:15 +0000 (08:11 +0000)]
[LLDB] - Add basic support for .debug_rnglists section (DWARF5)

This adds a basic support of the .debug_rnglists section.
Only the DW_RLE_start_length and DW_RLE_end_of_list entries are supported.

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

llvm-svn: 344119

6 years ago[clangd] Make FSProvider const-correct. NFC
Sam McCall [Wed, 10 Oct 2018 07:46:15 +0000 (07:46 +0000)]
[clangd] Make FSProvider const-correct. NFC

llvm-svn: 344118

6 years ago[X86] Remove FeatureRTM from Skylake processor list
Craig Topper [Wed, 10 Oct 2018 07:43:45 +0000 (07:43 +0000)]
[X86] Remove FeatureRTM from Skylake processor list

Summary:
There are a LOT of Skylakes and later without TSX-NI. Examples:
- SKL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3-20-GHz-
- KBL: https://ark.intel.com/products/97540/Intel-Core-i7-7560U-Processor-4M-Cache-up-to-3-80-GHz-
- KBL-R: https://ark.intel.com/products/149091/Intel-Core-i7-8565U-Processor-8M-Cache-up-to-4-60-GHz-
- CNL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3_20-GHz

This feature seems to be present only on high-end desktop and server
chips (I can't find any SKX without). This commit leaves it disabled
for all processors, but can be re-enabled for specific builds with
-mrtm.

Matches https://reviews.llvm.org/D53041

Patch by Thiago Macieira

Reviewers: erichkeane, craig.topper

Reviewed By: craig.topper

Subscribers: lebedev.ri, cfe-commits

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

llvm-svn: 344117

6 years ago[X86] Remove FeatureRTM from Skylake processor list
Craig Topper [Wed, 10 Oct 2018 07:43:35 +0000 (07:43 +0000)]
[X86] Remove FeatureRTM from Skylake processor list

Summary:
There are a LOT of Skylakes and later without TSX-NI. Examples:
- SKL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3-20-GHz-
- KBL: https://ark.intel.com/products/97540/Intel-Core-i7-7560U-Processor-4M-Cache-up-to-3-80-GHz-
- KBL-R: https://ark.intel.com/products/149091/Intel-Core-i7-8565U-Processor-8M-Cache-up-to-4-60-GHz-
- CNL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3_20-GHz

This feature seems to be present only on high-end desktop and server
chips (I can't find any SKX without). This commit leaves it disabled
for all processors, but can be re-enabled for specific builds with
-mrtm.

Patch by Thiago Macieira

Reviewers: erichkeane, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 344116

6 years ago[SystemZ] Take better care when computing needed vector registers in TTI.
Jonas Paulsson [Wed, 10 Oct 2018 07:36:27 +0000 (07:36 +0000)]
[SystemZ]  Take better care when computing needed vector registers in TTI.

A new function getNumVectorRegs() is better to use for the number of needed
vector registers instead of getNumberOfParts(). This is to make sure that the
number of vector registers (and typically operations) required for a vector
type is accurate.

getNumberOfParts() which was previously used works by splitting the vector
type until it is legal gives incorrect results for types with a non
power of two number of elements (rare).

A new static function getScalarSizeInBits() that also checks for a pointer
type and returns 64U for it since otherwise it gets a value of 0). Used in a
few places where Ty may be pointer.

Review: Ulrich Weigand
llvm-svn: 344115

6 years ago[Analysis] Make LocationSizes carry an 'imprecise' bit
George Burgess IV [Wed, 10 Oct 2018 06:39:40 +0000 (06:39 +0000)]
[Analysis] Make LocationSizes carry an 'imprecise' bit

There are places where we need to merge multiple LocationSizes of
different sizes into one, and get a sensible result.

There are other places where we want to optimize aggressively based on
the value of a LocationSizes (e.g. how can a store of four bytes be to
an area of storage that's only two bytes large?)

This patch makes LocationSize hold an 'imprecise' bit to note whether
the LocationSize can be treated as an upper-bound and lower-bound for
the size of a location, or just an upper-bound.

This concludes the series of patches leading up to this. The most recent
of which is r344108.

Fixes PR36228.

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

llvm-svn: 344114