platform/upstream/llvm.git
5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 years ago[NFC] Make a variable const
Max Kazantsev [Wed, 10 Oct 2018 04:19:38 +0000 (04:19 +0000)]
[NFC] Make a variable const

llvm-svn: 344113

5 years ago[PowerPC][NFC] Add a test case for extract and store patterns
Nemanja Ivanovic [Wed, 10 Oct 2018 04:18:35 +0000 (04:18 +0000)]
[PowerPC][NFC] Add a test case for extract and store patterns

An upcoming patch will change the codegen for these patterns. This test case is
added now so that the patch can show the differences in codegen.

llvm-svn: 344112

5 years ago[AVR] Fix the 'call.ll' CodeGen test
Dylan McKay [Wed, 10 Oct 2018 03:21:42 +0000 (03:21 +0000)]
[AVR] Fix the 'call.ll' CodeGen test

Commit r343851 changed the format of the generated instructions.

An unnecessary load has been removed. Previously, a value would be moved
from r24 into a temporary register just to be copied into r30 before the
indirect call. Now, codegen immediately loads r24 into r30, saving a
MOVW instruction.

llvm-svn: 344111

5 years agoExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.
James Y Knight [Wed, 10 Oct 2018 02:53:43 +0000 (02:53 +0000)]
ExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.

And, since EM_OffsetFold is now unused, remove it.

While builtin_object_size intends to ignore the presence of
side-effects in its argument, the EM_OffsetFold mode was NOT
configured to ignore side-effects. Rather it was effectively identical
to EM_ConstantFold -- its explanatory comment
notwithstanding.

However, currently, keepEvaluatingAfterSideEffect() is not always
honored -- sometimes evaluation continues despite it returning
false. Therefore, since the b_o_s code was only checking the return
value from evaluation, and not additionally checking the
HasSideEffects flag, side-effects _were_ in many cases actually being
ignored.

This change is a prerequisite cleanup towards fixing that issue.

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

llvm-svn: 344110

5 years ago[PowerPC] Fix the assert of ISD::SIGN_EXTEND_INREG when type is v2i16 and v2i8
QingShan Zhang [Wed, 10 Oct 2018 02:33:48 +0000 (02:33 +0000)]
[PowerPC] Fix the assert of ISD::SIGN_EXTEND_INREG when type is v2i16 and v2i8
For ISD::SIGN_EXTEND_INREG operation of v2i16 and v2i8 types will cause assert because they are registered as custom operation.
So that the type legalization phase will enter the custom hook, which do not handle ISD::SIGN_EXTEND_INREG operation and fall throw into unreachable assert.

Patch By: wuzish (Zixuan Wu)
Differential Revision: https://reviews.llvm.org/D52449

llvm-svn: 344109

5 years ago[Analysis] Make LocationSize pretty-printing more descriptive
George Burgess IV [Wed, 10 Oct 2018 01:35:22 +0000 (01:35 +0000)]
[Analysis] Make LocationSize pretty-printing more descriptive

This is the third patch in a series intended to make
https://reviews.llvm.org/D44748 more easily reviewable. Please see that
patch for more context. The second being r344013.

The intent is to make the output of printing a LocationSize more
precise. The main motivation for this is that we plan to add a bit to
distinguish whether a given LocationSize is an upper-bound or is
precise; making that information available in pretty-printing is nice.

llvm-svn: 344108

5 years ago[WebAssembly] Fix fneg lowering
Thomas Lively [Wed, 10 Oct 2018 01:09:09 +0000 (01:09 +0000)]
[WebAssembly] Fix fneg lowering

Summary:
Subtraction from zero and floating point negation do not have the same
semantics, so fix lowering.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 344107

5 years ago[WebAssembly] Improve comments for SIMD instruction definitions
Heejin Ahn [Wed, 10 Oct 2018 01:04:02 +0000 (01:04 +0000)]
[WebAssembly] Improve comments for SIMD instruction definitions

llvm-svn: 344106

5 years ago[libFuzzer] Disable value profiling tests on ARM
George Karpenkov [Wed, 10 Oct 2018 00:58:03 +0000 (00:58 +0000)]
[libFuzzer] Disable value profiling tests on ARM

Some seem fragile, some fail, and some just take a really long time to run.
It does not seem to make sense to support some subset of value profiling tests.

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

llvm-svn: 344105

5 years ago[libFuzzer] Generalize the code for getting the previous offset for different archite...
George Karpenkov [Wed, 10 Oct 2018 00:57:44 +0000 (00:57 +0000)]
[libFuzzer] Generalize the code for getting the previous offset for different architectures

Without this change, tests in coverage.test and dump_coverage.test are
failing on non-x86_64 platforms.
The diff is copied from sanitizer_common library, an alternative would
be to link it together with libFuzzer.

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

llvm-svn: 344104

5 years ago[sancov] Generalize the code to get the previous instruction to multiple architectures
George Karpenkov [Wed, 10 Oct 2018 00:57:24 +0000 (00:57 +0000)]
[sancov] Generalize the code to get the previous instruction to multiple architectures

sancov subtracts one from the address to get the previous instruction,
which makes sense on x86_64, but not on other platforms.
This change ensures that the offset is correct for different platforms.
The logic for computing the offset is copied from sanitizer_common.

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

llvm-svn: 344103

5 years agoAdd "var" and "vo" aliases for "frame variable" and "frame variable -O".
Jim Ingham [Wed, 10 Oct 2018 00:51:30 +0000 (00:51 +0000)]
Add "var" and "vo" aliases for "frame variable" and "frame variable -O".

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

llvm-svn: 344102

5 years ago[Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from...
Erik Pilkington [Wed, 10 Oct 2018 00:40:50 +0000 (00:40 +0000)]
[Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

These two diagnostics are noisy, so its reasonable for users to opt-out of them
when -Wconversion is enabled.

rdar://45058981

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

llvm-svn: 344101

5 years agoclang: Allow ifunc resolvers to accept arguments
Ed Maste [Wed, 10 Oct 2018 00:34:17 +0000 (00:34 +0000)]
clang: Allow ifunc resolvers to accept arguments

When ifunc support was added to Clang (r265917) it did not allow
resolvers to take function arguments.  This was based on GCC's
documentation, which states resolvers return a pointer and take no
arguments.

However, GCC actually allows resolvers to take arguments, and glibc (on
non-x86 platforms) and FreeBSD (on x86 and arm64) pass some CPU
identification information as arguments to ifunc resolvers.  I believe
GCC's documentation is simply incorrect / out-of-date.

FreeBSD already removed the prohibition in their in-tree Clang copy.

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

llvm-svn: 344100

5 years agoAdapt OptTable::PrintHelp change in D51009
Fangrui Song [Wed, 10 Oct 2018 00:15:36 +0000 (00:15 +0000)]
Adapt OptTable::PrintHelp change in D51009

Summary: Before, OptTable::PrintHelp append "[options] <inputs>" to its parameter `Help`. It is more flexible to change its semantic to `Usage` and let user customize the usage line.

Reviewers: rupprecht, ruiu, espindola

Reviewed By: rupprecht

Subscribers: emaste, sbc100, arichardson, aheejin, llvm-commits

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

llvm-svn: 344099

5 years ago[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."
Fangrui Song [Wed, 10 Oct 2018 00:15:33 +0000 (00:15 +0000)]
[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."

Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009

Reviewers: rupprecht, alexshap, jhenderson

Reviewed By: rupprecht

Subscribers: cfe-commits

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

llvm-svn: 344098

5 years ago[opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append...
Fangrui Song [Wed, 10 Oct 2018 00:15:31 +0000 (00:15 +0000)]
[opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>"

Summary:
Before, "[options] <inputs>" is unconditionally appended to the `Name` parameter. It is more flexible to change its semantic to `Usage` and let user customize the usage line.

% llvm-objcopy
...
USAGE: llvm-objcopy <input> [ <output> ] [options] <inputs>

With this patch:

% llvm-objcopy
...
USAGE: llvm-objcopy input [output]

Reviewers: rupprecht, alexshap, jhenderson

Reviewed By: rupprecht

Subscribers: jakehehrlich, mehdi_amini, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 344097

5 years agoAnnotate scoped_lock as with scoped_lockable attribute
Aaron Puchert [Tue, 9 Oct 2018 23:42:29 +0000 (23:42 +0000)]
Annotate scoped_lock as with scoped_lockable attribute

Summary:
Scoped capabilities need to be annotated as such, otherwise the thread
safety analysis won't work as intended.

Fixes PR39234.

Reviewers: ldionne

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

llvm-svn: 344096

5 years ago[git-llvm] Fix some issues surrouding EOL conversion on Windows.
Zachary Turner [Tue, 9 Oct 2018 23:42:28 +0000 (23:42 +0000)]
[git-llvm] Fix some issues surrouding EOL conversion on Windows.

This patch fixes three issues.

The first is that we didn't consider files which are explicitly
set to eolstyle CRLF in the repo, and there are a handful of
these.

Second is that dos2unix doesn't have a -q option in GnuWin32,
so this codepath wasn't working properly.

Finally with newer versions of Python (or newer versions of Git,
or some combination of the two) patches can't be applied when
we treat stdin as text, because Python silently undoes all the
work we did to convert the newlines to LF using dos2unix by
using universal_newlines=True and then converting them *back*
to CRLF.  So we need to add a way to force stdin to be treated
as binary, and use it when LF-newlines are required.

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

llvm-svn: 344095

5 years ago[WebAssembly] Handle V128 register class in explicit locals pass
Thomas Lively [Tue, 9 Oct 2018 23:33:16 +0000 (23:33 +0000)]
[WebAssembly] Handle V128 register class in explicit locals pass

Summary:
Also add tests to catch crashes in passes that are not normally run in
tests.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 344094

5 years ago[DAGCombiner] Expand combining of FP logical ops to sign-setting FP ops
Nemanja Ivanovic [Tue, 9 Oct 2018 23:20:11 +0000 (23:20 +0000)]
[DAGCombiner] Expand combining of FP logical ops to sign-setting FP ops

We already do the following combines:
(bitcast int (and (bitcast fp X to int), 0x7fff...) to fp) -> fabs X
(bitcast int (xor (bitcast fp X to int), 0x8000...) to fp) -> fneg X

When the target has "bit preserving fp logic". This patch just extends it
to also combine:
(bitcast int (or (bitcast fp X to int), 0x8000...) to fp) -> fneg (fabs X)

As some targets have fnabs and even those that don't can efficiently lower
both the fabs and the fneg.

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

llvm-svn: 344093

5 years ago[X86] Fix sanitizer bot failure from 344085
Rong Xu [Tue, 9 Oct 2018 23:10:56 +0000 (23:10 +0000)]
[X86] Fix sanitizer bot failure from 344085

Fix the memory issue exposed by sanitizer.

llvm-svn: 344092

5 years ago[PowerPC][NFC] Commit nabs test case in preparation for committing D44548
Nemanja Ivanovic [Tue, 9 Oct 2018 23:02:53 +0000 (23:02 +0000)]
[PowerPC][NFC] Commit nabs test case in preparation for committing D44548

This just adds the test case so that the different code gen is clearly visible
when the DAG Combine lands.

llvm-svn: 344091

5 years agoMerge two overloaded functions into one function. NFC.
Rui Ueyama [Tue, 9 Oct 2018 22:44:53 +0000 (22:44 +0000)]
Merge two overloaded functions into one function. NFC.

llvm-svn: 344089

5 years agoReturn early. NFC.
Rui Ueyama [Tue, 9 Oct 2018 22:44:42 +0000 (22:44 +0000)]
Return early. NFC.

llvm-svn: 344088