platform/upstream/llvm.git
5 years ago[X86] Remove a couple places where we unnecessarily pass 0 to the EmitPriority of...
Craig Topper [Wed, 30 Jan 2019 07:33:24 +0000 (07:33 +0000)]
[X86] Remove a couple places where we unnecessarily pass 0 to the EmitPriority of some FP instruction aliases. NFC

As far as I can tell we already won't emit these aliases due to an operand count check in the tablegen code. Removing these because I couldn't make sense of the inconsistency between fadd and fmul from reading the code.

I checked the AsmMatcher and AsmWriter files before and after this change and there were no differences.

llvm-svn: 352608

5 years ago[X86] Add FPSW as a Def on some FP instructions that were missing it.
Craig Topper [Wed, 30 Jan 2019 07:08:44 +0000 (07:08 +0000)]
[X86] Add FPSW as a Def on some FP instructions that were missing it.

llvm-svn: 352607

5 years agoRecognize FreeBSD specific BFD names in OUTPUT_FORMAT
Dimitry Andric [Wed, 30 Jan 2019 06:31:52 +0000 (06:31 +0000)]
Recognize FreeBSD specific BFD names in OUTPUT_FORMAT

Summary:
After rLLD344952 ("Add OUTPUT_FORMAT linker script directive support"),
using BFD names such as `elf64-x86-64-freebsd` the `OUTPUT_FORMAT`
linker script command does not work anymore, resulting in errors like:

```
ld: error: /home/dim/src/clang800-import/stand/efi/loader/arch/amd64/ldscript.amd64:2: unknown output format name: elf64-x86-64-freebsd
>>> OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
>>>               ^
```

To fix this, recognize a `-freebsd` suffix in BFD names, and also set
`Configuration::OSABI` to `ELFOSABI_FREEBSD` for those cases.

Add and/or update several test cases to check for the correct results of
these new `OUTPUT_FORMAT` arguments.

Reviewers: ruiu, atanasyan, grimar, hokein, emaste, espindola

Reviewed By: ruiu

Subscribers: nemanjai, javed.absar, arichardson, krytarowski, kristof.beyls, kbarton, llvm-commits

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

llvm-svn: 352606

5 years ago[ModuleDependencyCollector] Use llvm::sys::fs::real_path (NFC)
Jonas Devlieghere [Wed, 30 Jan 2019 06:26:26 +0000 (06:26 +0000)]
[ModuleDependencyCollector] Use llvm::sys::fs::real_path (NFC)

Use the real_path implementation from llvm::sys::fs::real_path instead
of having a custom implementation in the ModuleDependencyCollector.

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

llvm-svn: 352605

5 years ago[libFuzzer] remove stale code, NFC
Kostya Serebryany [Wed, 30 Jan 2019 06:21:20 +0000 (06:21 +0000)]
[libFuzzer] remove stale code, NFC

llvm-svn: 352604

5 years ago[libFuzzer] refactor the handling of instrumentation counters so that they are groupe...
Kostya Serebryany [Wed, 30 Jan 2019 06:15:52 +0000 (06:15 +0000)]
[libFuzzer] refactor the handling of instrumentation counters so that they are grouped in regions one full page each. Needed for future optimization. NFC

llvm-svn: 352603

5 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Wed, 30 Jan 2019 05:26:31 +0000 (05:26 +0000)]
[NFC] fix trivial typos in comments

llvm-svn: 352602

5 years agoGlobalISel: Implement fewerElementsVector for select
Matt Arsenault [Wed, 30 Jan 2019 04:19:31 +0000 (04:19 +0000)]
GlobalISel: Implement fewerElementsVector for select

llvm-svn: 352601

5 years ago[IR] Use CallBase to simplify some code
Craig Topper [Wed, 30 Jan 2019 03:43:41 +0000 (03:43 +0000)]
[IR] Use CallBase to simplify some code

Summary:
This patch does the following to simplify the asm-goto patch

-Move isInlineAsm from CallInst to CallBase to share with CallBrInst in the asm-goto patch.
-Forward CallSite's data_operands_begin()/data_operands_end() to CallBase's implementation.
-Forward CallSite's getOperandBundlesAsDefs to CallBase.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: nickdesaulniers, llvm-commits

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

llvm-svn: 352600

5 years agoAMDGPU/GlobalISel: Fix clamping shifts with 16-bit insts
Matt Arsenault [Wed, 30 Jan 2019 03:36:25 +0000 (03:36 +0000)]
AMDGPU/GlobalISel: Fix clamping shifts with 16-bit insts

llvm-svn: 352599

5 years ago[WebAssembly] Exception handling: Switch to the new proposal
Heejin Ahn [Wed, 30 Jan 2019 03:21:57 +0000 (03:21 +0000)]
[WebAssembly] Exception handling: Switch to the new proposal

Summary:
This switches the EH implementation to the new proposal:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
(The previous proposal was
 https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions.md)

- Instruction changes
  - Now we have one single `catch` instruction that returns a except_ref
    value
  - `throw` now can take variable number of operations
  - `rethrow` does not have 'depth' argument anymore
  - `br_on_exn` queries an except_ref to see if it matches the tag and
    branches to the given label if true.
  - `extract_exception` is a pseudo instruction that simulates popping
    values from wasm stack. This is to make `br_on_exn`, a very special
    instruction, work: `br_on_exn` puts values onto the stack only if it
    is taken, and the # of values can vay depending on the tag.

- Now there's only one `catch` per `try`, this patch removes all special
  handling for terminate pad with a call to `__clang_call_terminate`.
  Before it was the only case there are two catch clauses (a normal
  `catch` and `catch_all` per `try`).

- Make `rethrow` act as a terminator like `throw`. This splits BB after
  `rethrow` in WasmEHPrepare, and deletes an unnecessary `unreachable`
  after `rethrow` in LateEHPrepare.

- Now we stop at all catchpads (because we add wasm `catch` instruction
  that catches all exceptions), this creates new
  `findWasmUnwindDestinations` function in SelectionDAGBuilder.

- Now we use `br_on_exn` instrution to figure out if an except_ref
  matches the current tag or not, LateEHPrepare generates this sequence
  for catch pads:
```
  catch
  block i32
  br_on_exn $__cpp_exception
  end_block
  extract_exception
```

- Branch analysis for `br_on_exn` in WebAssemblyInstrInfo

- Other various misc. changes to switch to the new proposal.

Reviewers: dschuff

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

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

llvm-svn: 352598

5 years agoGlobalISel: Use appropriate extension for legalizing select conditions
Matt Arsenault [Wed, 30 Jan 2019 02:57:43 +0000 (02:57 +0000)]
GlobalISel: Use appropriate extension for legalizing select conditions

llvm-svn: 352597

5 years ago[PowerPC] [NFC] Create a helper function to copy register to particular register...
Zi Xuan Wu [Wed, 30 Jan 2019 02:56:22 +0000 (02:56 +0000)]
[PowerPC] [NFC] Create a helper function to copy register to particular register class at PPCFastISel

Make copy register code as common function as following.

unsigned copyRegToRegClass(const TargetRegisterClass *ToRC, unsigned SrcReg, unsigned Flag = 0, unsigned SubReg = 0);

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

llvm-svn: 352596

5 years agoCleanup: replace uses of CallSite with CallBase.
James Y Knight [Wed, 30 Jan 2019 02:54:28 +0000 (02:54 +0000)]
Cleanup: replace uses of CallSite with CallBase.

llvm-svn: 352595

5 years agoGlobalISel: Support narrowScalar for uneven loads
Matt Arsenault [Wed, 30 Jan 2019 02:35:38 +0000 (02:35 +0000)]
GlobalISel: Support narrowScalar for uneven loads

llvm-svn: 352594

5 years agoSimplify and modernize this code a little.
Richard Smith [Wed, 30 Jan 2019 02:23:34 +0000 (02:23 +0000)]
Simplify and modernize this code a little.

No functionality change intended.

llvm-svn: 352593

5 years ago[WebAssembly] Optimize BUILD_VECTOR lowering for size
Thomas Lively [Wed, 30 Jan 2019 02:23:29 +0000 (02:23 +0000)]
[WebAssembly] Optimize BUILD_VECTOR lowering for size

Summary:
Implements custom lowering logic that finds the optimal value for the
initial splat of the vector and either uses it or uses v128.const if
it is available and if it would produce smaller code. This logic
replaces large TableGen ISEL patterns that would lower all non-splat
BUILD_VECTORs into a splat followed by a fixed number of replace_lane
instructions. This CL fixes PR39685.

Reviewers: aheejin

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

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

llvm-svn: 352592

5 years agoGlobalISel: Handle some odd splits in fewerElementsVector
Matt Arsenault [Wed, 30 Jan 2019 02:22:13 +0000 (02:22 +0000)]
GlobalISel: Handle some odd splits in fewerElementsVector

Also add some quick hacks to AMDGPU legality for the tests.

llvm-svn: 352591

5 years agolld/coff: Implement some support for the comdat selection field
Nico Weber [Wed, 30 Jan 2019 02:17:27 +0000 (02:17 +0000)]
lld/coff: Implement some support for the comdat selection field

LLD used to handle comdats as if the selection field was always set to
IMAGE_COMDAT_SELECT_ANY. This means for obj files produced by `cl /Gy`, LLD
would never report a duplicate symbol error.

This change:
- adds validation for the Selection field (should make no difference in
  practice for compiler-generated obj inputs)
- rejects comdats that have different Selection fields in different obj files
  (likewise). This is a bit more strict but also more self-consistent thank
  link.exe (see comment in code)
- implements handling for all the selection kinds

In practice, compilers only generate comdats with
IMAGE_COMDAT_SELECT_NODUPLICATES (LLD now produces duplicate symbol errors for
these), IMAGE_COMDAT_SELECT_ANY (no behavior change), and
IMAGE_COMDAT_SELECT_LARGEST (for RTTI data; here LLD should no longer create
broken executables when linking some TUs with RTTI enabled and some with it
disabled – but see below).

The implementation of `IMAGE_COMDAT_SELECT_LARGEST` is incomplete: If one
SELECT_LARGEST comdat replaces an earlier one, the comdat symbol is replaced
correctly, but the old section stays loaded and if /opt:ref is disabled (via
/opt:noref or /debug) it's still written to the output. That's not ideal, but
better than the current treatment of just picking any one of those comdats. I
hope to fix this better later.

Fixes most of PR40094.

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

llvm-svn: 352590

5 years agolld-link: Add test I forgot to add in 332012
Nico Weber [Wed, 30 Jan 2019 02:15:08 +0000 (02:15 +0000)]
lld-link: Add test I forgot to add in 332012

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

llvm-svn: 352589

5 years ago[analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of Objective...
George Karpenkov [Wed, 30 Jan 2019 02:11:04 +0000 (02:11 +0000)]
[analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of Objective-C methods

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

llvm-svn: 352588

5 years agoAdd enum values to CodeGenOpt::Level
Sam Clegg [Wed, 30 Jan 2019 02:08:34 +0000 (02:08 +0000)]
Add enum values to CodeGenOpt::Level

The absolute values of this enum are important at least in that
they get printed by SelectionDAGISel. e.g:
  `Before: -O2 ; After: -O0`

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

llvm-svn: 352587

5 years ago[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard
Petr Hosek [Wed, 30 Jan 2019 02:06:06 +0000 (02:06 +0000)]
[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard

Turned out this is used by Flutter which uses Fuchsia Clang toolchain.

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

llvm-svn: 352586

5 years agoGlobalISel: Handle more cases for widenScalar for G_STORE
Matt Arsenault [Wed, 30 Jan 2019 02:04:31 +0000 (02:04 +0000)]
GlobalISel: Handle more cases for widenScalar for G_STORE

llvm-svn: 352585

5 years ago[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia
Petr Hosek [Wed, 30 Jan 2019 02:02:25 +0000 (02:02 +0000)]
[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia

In addition to libc++abi and libc++, we also want to use hermetic
static libunwind on Fuchsia.

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

llvm-svn: 352584

5 years ago[PowerPC] more opportunity for converting reg+reg to reg+imm
Chen Zheng [Wed, 30 Jan 2019 01:57:01 +0000 (01:57 +0000)]
[PowerPC] more opportunity for converting reg+reg to reg+imm
Differential Revision: https://reviews.llvm.org/D57314

llvm-svn: 352583

5 years agoAdd 8.0 release bug to merge request script
Matt Arsenault [Wed, 30 Jan 2019 01:10:47 +0000 (01:10 +0000)]
Add 8.0 release bug to merge request script

llvm-svn: 352579

5 years agoGlobalISel: Verify memory size for load/store
Matt Arsenault [Wed, 30 Jan 2019 01:10:42 +0000 (01:10 +0000)]
GlobalISel: Verify memory size for load/store

llvm-svn: 352578

5 years ago[libFuzzer] update a test
Kostya Serebryany [Wed, 30 Jan 2019 00:36:28 +0000 (00:36 +0000)]
[libFuzzer] update a test

llvm-svn: 352577

5 years agoRemove a redundant space from an error message; NFC
George Burgess IV [Wed, 30 Jan 2019 00:28:56 +0000 (00:28 +0000)]
Remove a redundant space from an error message; NFC

llvm-svn: 352576

5 years ago[WebAssembly] Fix undefined weak function symbols in LTO builds
Sam Clegg [Wed, 30 Jan 2019 00:25:52 +0000 (00:25 +0000)]
[WebAssembly] Fix undefined weak function symbols in LTO builds

Summary: Fixes PR40219

Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 352575

5 years agoFix thread safety tests after r352549
Aaron Puchert [Wed, 30 Jan 2019 00:18:24 +0000 (00:18 +0000)]
Fix thread safety tests after r352549

llvm-svn: 352574

5 years ago[WebAssembly] Add missing SymbolRef update from rL352551
Sam Clegg [Wed, 30 Jan 2019 00:15:48 +0000 (00:15 +0000)]
[WebAssembly] Add missing SymbolRef update from rL352551

This change broke some MC tests which are now fixed.

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

llvm-svn: 352573

5 years ago[analyzer] NFC: GenericTaintChecker: Revise rule specification mechanisms.
Artem Dergachev [Wed, 30 Jan 2019 00:06:43 +0000 (00:06 +0000)]
[analyzer] NFC: GenericTaintChecker: Revise rule specification mechanisms.

Provide a more powerful and at the same time more readable way of specifying
taint propagation rules for known functions within the checker.

Now it should be possible to specify an unlimited amount of source and
destination parameters for taint propagation.

No functional change intended just yet.

Patch by Gábor Borsik!

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

llvm-svn: 352572

5 years ago[libFuzzer] remove stale code
Kostya Serebryany [Tue, 29 Jan 2019 23:53:28 +0000 (23:53 +0000)]
[libFuzzer] remove stale code

llvm-svn: 352571

5 years agoAdd FileCollector + test to Xcode project.
Jonas Devlieghere [Tue, 29 Jan 2019 23:48:53 +0000 (23:48 +0000)]
Add FileCollector + test to Xcode project.

llvm-svn: 352570

5 years ago[WebAssembly] Lower SCALAR_TO_VECTOR to splats
Thomas Lively [Tue, 29 Jan 2019 23:44:48 +0000 (23:44 +0000)]
[WebAssembly] Lower SCALAR_TO_VECTOR to splats

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish

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

llvm-svn: 352568

5 years ago[libFuzzer] revert an accidental commit
Kostya Serebryany [Tue, 29 Jan 2019 23:41:50 +0000 (23:41 +0000)]
[libFuzzer] revert an accidental commit

llvm-svn: 352567

5 years ago[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]
Kostya Serebryany [Tue, 29 Jan 2019 23:40:05 +0000 (23:40 +0000)]
[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]

llvm-svn: 352566

5 years agoGlobalISel: Fix unused variable warning in release builds
Matt Arsenault [Tue, 29 Jan 2019 23:38:42 +0000 (23:38 +0000)]
GlobalISel: Fix unused variable warning in release builds

llvm-svn: 352565

5 years ago[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]
Kostya Serebryany [Tue, 29 Jan 2019 23:37:20 +0000 (23:37 +0000)]
[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]

llvm-svn: 352564

5 years ago[IR] Use CallBase to reduce code duplication. NFC
Craig Topper [Tue, 29 Jan 2019 23:31:54 +0000 (23:31 +0000)]
[IR] Use CallBase to reduce code duplication. NFC

Noticed in the asm-goto patch. Callbr needs to go here too. One cast and call is better than 3.

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

llvm-svn: 352563

5 years agoGlobalISel: Verify pointer casts
Matt Arsenault [Tue, 29 Jan 2019 23:29:00 +0000 (23:29 +0000)]
GlobalISel: Verify pointer casts

Not sure if the old AArch64 tests should be just
deleted or not.

llvm-svn: 352562

5 years ago[libc++] Fix Windows build error in <functional>
Thomas Anderson [Tue, 29 Jan 2019 23:19:45 +0000 (23:19 +0000)]
[libc++] Fix Windows build error in <functional>

On my Windows system, __allocator is defined to nothing.  This change fixes build errors of the below form:

    In file included from algorithm:644:
    functional(1492,31):  error: expected member name or ';' after declaration specifiers
        const _Alloc& __allocator() const { return __f_.second(); }

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

llvm-svn: 352561

5 years agoGlobalISel: Partially implement widenScalar for MERGE_VALUES
Matt Arsenault [Tue, 29 Jan 2019 23:17:35 +0000 (23:17 +0000)]
GlobalISel: Partially implement widenScalar for MERGE_VALUES

llvm-svn: 352560

5 years ago[libunwind] Support building hermetic static library
Petr Hosek [Tue, 29 Jan 2019 23:01:08 +0000 (23:01 +0000)]
[libunwind] Support building hermetic static library

This is useful when the static libunwind library is being linked into
shared libraries that may be used in with other shared libraries that
use different unwinder. We want to avoid avoid exporting libunwind
symbols in those cases. This achieved by a new CMake option which can be
enabled by libunwind vendors as needed.

The same CMake option has already been added to libc++ and libc++abi in
D55404 and D56026.

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

llvm-svn: 352559

5 years agoNFC: Move GenericSelectionExpr dump to NodeDumper
Stephen Kelly [Tue, 29 Jan 2019 22:58:28 +0000 (22:58 +0000)]
NFC: Move GenericSelectionExpr dump to NodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 352558

5 years agoFix some warnings in building LLDB.
Zachary Turner [Tue, 29 Jan 2019 22:55:21 +0000 (22:55 +0000)]
Fix some warnings in building LLDB.

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

llvm-svn: 352557

5 years ago[test] Use correct macro in FileCollectorTest.cpp
Jonas Devlieghere [Tue, 29 Jan 2019 22:53:47 +0000 (22:53 +0000)]
[test] Use correct macro in FileCollectorTest.cpp

This test was supposed to be skipped on Windows but was using the wrong
macro name.

llvm-svn: 352556

5 years agoCheck bool attribute value in getOptionalBoolLoopAttribute.
Alina Sbirlea [Tue, 29 Jan 2019 22:33:20 +0000 (22:33 +0000)]
Check bool attribute value in getOptionalBoolLoopAttribute.

Summary:
Check the bool value of the attribute in getOptionalBoolLoopAttribute
not just its existance.
Eliminates the warning noise generated when vectorization is explicitly disabled.

Reviewers: Meinersbur, hfinkel, dmgreen

Subscribers: jlebar, sanjoy, llvm-commits

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

llvm-svn: 352555

5 years ago[WebAssembly] Don't load weak undefined symbols from archive files
Sam Clegg [Tue, 29 Jan 2019 22:26:31 +0000 (22:26 +0000)]
[WebAssembly] Don't load weak undefined symbols from archive files

Summary: Fixes PR40494

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

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

llvm-svn: 352554

5 years agoDrop the dependency on <algorithm>, add placement new inline
Petr Hosek [Tue, 29 Jan 2019 22:26:18 +0000 (22:26 +0000)]
Drop the dependency on <algorithm>, add placement new inline

We haven't eliminated C++ library dependency altogether in D57251,
UnwindCursor.hpp had an unused dependency on <algorithm> which was
pulling in other C++ headers. Removing that dependency also revealed
(correctly) that we need our own global placement new declaration. Now
libunwind should be independent of the C++ library.

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

llvm-svn: 352553

5 years agoNFC: Implement GenericSelectionExpr::Association dump with Visitor
Stephen Kelly [Tue, 29 Jan 2019 22:22:55 +0000 (22:22 +0000)]
NFC: Implement GenericSelectionExpr::Association dump with Visitor

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 352552

5 years ago[WebAssembly] Ensure BasicSymbolRef.getRawDataRefImpl().p is non-null
Sam Clegg [Tue, 29 Jan 2019 22:22:32 +0000 (22:22 +0000)]
[WebAssembly] Ensure BasicSymbolRef.getRawDataRefImpl().p is non-null

Store a non-zero value to ref.d.a and use ref.d.b to store the symbol
index.  This means that ref.p is never null, which was confusing
llvm-nm.

Fixes PR40497

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

llvm-svn: 352551

5 years ago[docs] Prevent O0 optnone for opt input
Shoaib Meenai [Tue, 29 Jan 2019 22:17:51 +0000 (22:17 +0000)]
[docs] Prevent O0 optnone for opt input

If we just compile with -O0, clang will add optnone attributes
everywhere, so opt won't actually be able to perform any passes.
Instruct clang to not emit the optnone so opt can do its thing.

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

llvm-svn: 352550

5 years agoThread safety analysis: Improve diagnostics for double locking
Aaron Puchert [Tue, 29 Jan 2019 22:11:42 +0000 (22:11 +0000)]
Thread safety analysis: Improve diagnostics for double locking

Summary:
We use the existing diag::note_locked_here to tell the user where we saw
the first locking.

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 352549

5 years agoMake a blind attempt at fixing PDBASTParser nullability issues
Adrian Prantl [Tue, 29 Jan 2019 21:46:34 +0000 (21:46 +0000)]
Make a blind attempt at fixing PDBASTParser nullability issues

llvm-svn: 352548

5 years ago[AArch64][GlobalISel] Unmerge into scalars from a vector should use FPR bank.
Amara Emerson [Tue, 29 Jan 2019 21:19:33 +0000 (21:19 +0000)]
[AArch64][GlobalISel] Unmerge into scalars from a vector should use FPR bank.

This currently shows up as a selection fallback since the dest regs were given
GPR banks but the source was a vector FPR reg.

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

llvm-svn: 352545

5 years agoOpenCL: Try to fix bot test failure
Matt Arsenault [Tue, 29 Jan 2019 21:14:56 +0000 (21:14 +0000)]
OpenCL: Try to fix bot test failure

llvm-svn: 352544

5 years ago[OPENMP]Fix PR40513: lastprivate taskloop counter.
Alexey Bataev [Tue, 29 Jan 2019 21:12:28 +0000 (21:12 +0000)]
[OPENMP]Fix PR40513: lastprivate taskloop counter.

We don't need to use the predetermined data-sharing attributes for the
loop counters if the user explicitly specified correct data-sharing
attributes for such variables.

llvm-svn: 352543

5 years ago[cc1as] Test that -g of empty .s file does something sensible.
Paul Robinson [Tue, 29 Jan 2019 20:57:50 +0000 (20:57 +0000)]
[cc1as] Test that -g of empty .s file does something sensible.

Depends on LLVM r352541.

llvm-svn: 352542

5 years ago[DWARF] Emit reasonable debug info for empty .s files.
Paul Robinson [Tue, 29 Jan 2019 20:53:51 +0000 (20:53 +0000)]
[DWARF] Emit reasonable debug info for empty .s files.

llvm-svn: 352541

5 years agoOpenCL: Use length modifier for warning on vector printf arguments
Matt Arsenault [Tue, 29 Jan 2019 20:49:54 +0000 (20:49 +0000)]
OpenCL: Use length modifier for warning on vector printf arguments

Re-enable format string warnings on printf.

The warnings are still incomplete. Apparently it is undefined to use a
vector specifier without a length modifier, which is not currently
warned on. Additionally, type warnings appear to not be working with
the hh modifier, and aren't warning on all of the special restrictions
from c99 printf.

llvm-svn: 352540

5 years agoRevert "OpenCL: Extend argument promotion rules to vector types"
Matt Arsenault [Tue, 29 Jan 2019 20:49:47 +0000 (20:49 +0000)]
Revert "OpenCL: Extend argument promotion rules to vector types"

This reverts r348083. This was based on a misreading of the spec
for printf specifiers.

Also revert r343653, as without a subsequent patch, a correctly
specified format for a vector will incorrectly warn.

Fixes bug 40491.

llvm-svn: 352539

5 years ago[Reproducers] Add file provider
Jonas Devlieghere [Tue, 29 Jan 2019 20:36:38 +0000 (20:36 +0000)]
[Reproducers] Add file provider

This patch adds the file provider which is responsible for capturing
files used by LLDB.

When capturing a reproducer, we use a file collector that is very
similar to the one used in clang. For every file that we touch, we add
an entry with a mapping from its virtual to its real path. When we
decide to generate a reproducer we copy over the files and their
permission into to reproducer folder.

When replaying a reproducer, we load the VFS mapping and instantiate a
RedirectingFileSystem. The latter will transparently use the files
available in the reproducer.

I've tested this on two macOS machines with an artificial example.
Still, it is very likely that I missed some places where we (still) use
native file system calls. I'm hoping to flesh those out while testing
with more advanced examples. However, I will fix those things in
separate patches.

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

llvm-svn: 352538

5 years agoFix the tests from r350970
Steven Wu [Tue, 29 Jan 2019 20:13:02 +0000 (20:13 +0000)]
Fix the tests from r350970

Relax the tests from r350970 to allow non-standard path for ld.

llvm-svn: 352537

5 years ago[InstCombine] canonicalize cmp/select form of uadd saturate with constant
Sanjay Patel [Tue, 29 Jan 2019 20:02:45 +0000 (20:02 +0000)]
[InstCombine] canonicalize cmp/select form of uadd saturate with constant

I'm circling back around to a loose end from D51929.

The backend (either CGP or DAG) doesn't recognize this pattern, so we end up with different asm for these IR variants.

Regardless of any future changes to canonicalize to saturation/overflow intrinsics, we want to get raw IR variations
into the minimal number of raw IR forms. If/when we can canonicalize to intrinsics, that will make that step easier.

  Pre: C2 == ~C1
  %a = add i32 %x, C1
  %c = icmp ugt i32 %x, C2
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, C1
  %c2 = icmp ult i32 %x, C2
  %r = select i1 %c2, i32 %a, i32 -1

  https://rise4fun.com/Alive/pkH

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

llvm-svn: 352536

5 years agoFix the behavior of clang's -w flag.
James Y Knight [Tue, 29 Jan 2019 19:33:48 +0000 (19:33 +0000)]
Fix the behavior of clang's -w flag.

It is intended to disable _all_ warnings, even those upgraded to
errors via `-Werror=warningname` or `#pragma clang diagnostic error'

Fixes: https://llvm.org/PR38231
Differential Revision: https://reviews.llvm.org/D53199

llvm-svn: 352535

5 years ago[analyzer] [RetainCountChecker] Track input parameters to the top-level function
George Karpenkov [Tue, 29 Jan 2019 19:29:59 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Track input parameters to the top-level function

Track them for ISL/OS objects by default, and for NS/CF under a flag.

rdar://47536377

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

llvm-svn: 352534

5 years ago[analyzer] [RetainSummaryManager] [NFC] Split one function into two, as it's really...
George Karpenkov [Tue, 29 Jan 2019 19:29:45 +0000 (19:29 +0000)]
[analyzer] [RetainSummaryManager] [NFC] Split one function into two, as it's really doing two things

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

llvm-svn: 352533

5 years ago[analyzer] [ARCMT] [NFC] Unify entry point into RetainSummaryManager
George Karpenkov [Tue, 29 Jan 2019 19:29:33 +0000 (19:29 +0000)]
[analyzer] [ARCMT] [NFC] Unify entry point into RetainSummaryManager

Just use one single entry point, since we have AnyCall utility now.

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

llvm-svn: 352532

5 years agoExtend AnyCall to handle callable declarations without the call expressions
George Karpenkov [Tue, 29 Jan 2019 19:29:19 +0000 (19:29 +0000)]
Extend AnyCall to handle callable declarations without the call expressions

That weakens inner invariants, but allows the class to be more generic,
allowing usage in situations where the call expression is not known (or
should not matter).

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

llvm-svn: 352531

5 years ago[analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'
George Karpenkov [Tue, 29 Jan 2019 19:29:07 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'

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

llvm-svn: 352530

5 years ago[MinGW] Don't define names for ignored options. NFC.
Martin Storsjo [Tue, 29 Jan 2019 19:24:32 +0000 (19:24 +0000)]
[MinGW] Don't define names for ignored options. NFC.

Move them to the same section as the newly added ignored options
without a defined name.

Also move options that actually weren't ignored to the right section.

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

llvm-svn: 352529

5 years ago[DAGCombiner] fold extract_subvector of extract_subvector
Sanjay Patel [Tue, 29 Jan 2019 19:13:39 +0000 (19:13 +0000)]
[DAGCombiner] fold extract_subvector of extract_subvector

This is the sibling fold for insert-of-insert that was added with D56604.

Now that we have x86 shuffle narrowing (D57156), this change shows improvements for
lots of AVX512 reduction code (not sure that we would ever expect extract-of-extract otherwise).

There's a small regression in some of the partial-permute tests (extracting followed by splat).
That is tracked by PR40500:
https://bugs.llvm.org/show_bug.cgi?id=40500

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

llvm-svn: 352528

5 years ago[VFS] Fix warning and use better check.
Michael J. Spencer [Tue, 29 Jan 2019 19:07:15 +0000 (19:07 +0000)]
[VFS] Fix warning and use better check.

llvm-svn: 352527

5 years ago[OPENMP]Make the loop with unsigned counter countable.
Alexey Bataev [Tue, 29 Jan 2019 18:51:58 +0000 (18:51 +0000)]
[OPENMP]Make the loop with unsigned counter countable.

According to the report, better to keep the original strict compare
operation as the loop condition with unsigned loop counters to make the
loop countable. This allows further loop transformations.

llvm-svn: 352526

5 years ago[libc++] Fix Windows build error in include/filesystem
Thomas Anderson [Tue, 29 Jan 2019 18:48:35 +0000 (18:48 +0000)]
[libc++] Fix Windows build error in include/filesystem

_LIBCPP_FUNC_VIS is redundant since the class is already annotated with
_LIBCPP_EXCEPTION_ABI.

Fixes this build error:

    In file included from fstream:188:
    filesystem(1350,3):  error: attribute 'dllimport' cannot be applied to member of 'dllimport' class
      _LIBCPP_FUNC_VIS
    __config(674,37):  note: expanded from macro '_LIBCPP_FUNC_VIS'
    #define _LIBCPP_FUNC_VIS            _LIBCPP_DLL_VIS
    __config(666,38):  note: expanded from macro '_LIBCPP_DLL_VIS'
    #  define _LIBCPP_DLL_VIS __declspec(dllimport)
    filesystem(1313,7):  note: previous attribute is here
    class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
    __config(675,37):  note: expanded from macro '_LIBCPP_EXCEPTION_ABI'
    #define _LIBCPP_EXCEPTION_ABI       _LIBCPP_DLL_VIS
    __config(666,38):  note: expanded from macro '_LIBCPP_DLL_VIS'
    #  define _LIBCPP_DLL_VIS __declspec(dllimport)

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

llvm-svn: 352525

5 years agoRollback unwindlib patch.
Sterling Augustine [Tue, 29 Jan 2019 18:27:51 +0000 (18:27 +0000)]
Rollback unwindlib patch.

llvm-svn: 352524

5 years agoGlobalISel: Fix narrowScalar for load/store with different mem size
Matt Arsenault [Tue, 29 Jan 2019 18:13:02 +0000 (18:13 +0000)]
GlobalISel: Fix narrowScalar for load/store with different mem size

This was ignoring the memory size, and producing multiple loads/stores
if the operand size was different from the memory size.

I assume this is the intent of not having an explicit G_ANYEXTLOAD
(although I think that would probably be better).

llvm-svn: 352523

5 years agoFix PR40495 - is_invokable_v<void> does not compile
Eric Fiselier [Tue, 29 Jan 2019 18:01:14 +0000 (18:01 +0000)]
Fix PR40495 - is_invokable_v<void> does not compile

The meta-programming that attempted to form the invoke call expression
was not in a SFINAE context. This made it a hard error to provide
non-referencable types like 'void' or 'void (...) const'.

This patch fixes the error by checking the validity of the call
expression within a SFINAE context.

llvm-svn: 352522

5 years agoMake Type::GetByteSize optional (NFC)
Adrian Prantl [Tue, 29 Jan 2019 17:52:34 +0000 (17:52 +0000)]
Make Type::GetByteSize optional (NFC)

This is a continuation of my quest to make the size 0 a supported value.

This reapplies r352394 with additional PDB parser fixes prepared by
Pavel Labath!

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

llvm-svn: 352521

5 years ago[x86] add tests for vector bool math; NFC
Sanjay Patel [Tue, 29 Jan 2019 17:00:47 +0000 (17:00 +0000)]
[x86] add tests for vector bool math; NFC

llvm-svn: 352520

5 years ago[AArch64] add tests for vector bool math; NFC
Sanjay Patel [Tue, 29 Jan 2019 17:00:07 +0000 (17:00 +0000)]
[AArch64] add tests for vector bool math; NFC

llvm-svn: 352519

5 years ago[X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions.
Andrea Di Biagio [Tue, 29 Jan 2019 16:47:27 +0000 (16:47 +0000)]
[X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions.

Account for bypass delays when computing the latency of scalar int-to-float
conversions.
On Jaguar we need to account for an extra 6cy latency (see AMD fam16h SOG).
This patch also fixes the number of micropcodes for the register-memory variants
of scalar int-to-float conversions.

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

llvm-svn: 352518

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Tue, 29 Jan 2019 16:44:05 +0000 (16:44 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 352517

5 years agoAdd .clang-tidy and .clang-format files to the toplevel of the
James Y Knight [Tue, 29 Jan 2019 16:43:16 +0000 (16:43 +0000)]
Add .clang-tidy and .clang-format files to the toplevel of the
repository (the same content as those in llvm/ and clang/).

llvm-svn: 352516

5 years ago[InstCombine] add tests for ext-of-bool + add/sub; NFC
Sanjay Patel [Tue, 29 Jan 2019 16:39:23 +0000 (16:39 +0000)]
[InstCombine] add tests for ext-of-bool + add/sub; NFC

We should choose one of these as canonical:

  %z = zext i1 %cmp to i32
  %r = sub i32 %x, %z
  =>
  %s = sext i1 %cmp to i32
  %r = add i32 %x, %s

The test comments assume that the zext form is better,
but we can adjust that if we decide to go the other way.

llvm-svn: 352515

5 years agoAdjust documentation for git migration.
James Y Knight [Tue, 29 Jan 2019 16:37:27 +0000 (16:37 +0000)]
Adjust documentation for git migration.

This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

llvm-svn: 352514

5 years ago[NFC] Add missing revision for removal of bad_array_length in ABI changelog
Louis Dionne [Tue, 29 Jan 2019 16:30:11 +0000 (16:30 +0000)]
[NFC] Add missing revision for removal of bad_array_length in ABI changelog

llvm-svn: 352513

5 years agoMark some of the behavior in the move w/allocator constructors of deque/unordered...
Marshall Clow [Tue, 29 Jan 2019 16:12:45 +0000 (16:12 +0000)]
Mark some of the behavior in the move w/allocator constructors of deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out.

llvm-svn: 352512

5 years ago[clangd] Remove extra ';' to fix -Wpedantic warning. NFC
Ilya Biryukov [Tue, 29 Jan 2019 16:04:39 +0000 (16:04 +0000)]
[clangd] Remove extra ';' to fix -Wpedantic warning. NFC

llvm-svn: 352511

5 years ago[clangd] Attempt to fix failing buildbots after r352494
Ilya Biryukov [Tue, 29 Jan 2019 15:57:14 +0000 (15:57 +0000)]
[clangd] Attempt to fix failing buildbots after r352494

For failures see:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/38501/steps/build-unified-tree/logs/stdio

llvm-svn: 352510

5 years ago[clangd] Make -clang-tidy-checks a non-hidden command-line arg
Ilya Biryukov [Tue, 29 Jan 2019 15:52:05 +0000 (15:52 +0000)]
[clangd] Make -clang-tidy-checks a non-hidden command-line arg

Summary:
This looks like a useful user-facing configuration parameter,
which should be discoverable.

Also fix a small typo in the description.

Reviewers: hokein

Reviewed By: hokein

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 352509

5 years agolld-link: Allow backward references between associated comdats
Nico Weber [Tue, 29 Jan 2019 15:50:31 +0000 (15:50 +0000)]
lld-link: Allow backward references between associated comdats

References between associated comdats are invalid per COFF spec, but the newest
Windows SDK contains obj files that have these references
(https://bugs.chromium.org/p/chromium/issues/detail?id=925943#c13). So add back
support for them and add tests for them. The old code handled them fine.

This makes lld-link match the behavior of newer link.exe versions as far as I
can tell. (The behavior before this change matched the behavior of older
link.exe versions.)

This mostly reverts r352254.

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

llvm-svn: 352508

5 years agoBreakpadRecords: Add parsing code for FILE and LINE records
Pavel Labath [Tue, 29 Jan 2019 15:39:27 +0000 (15:39 +0000)]
BreakpadRecords: Add parsing code for FILE and LINE records

The two records aren't used by anything yet, but this part can be
separated out easily, so I am comitting it separately to simplify
reviews of the followup patch.

llvm-svn: 352507

5 years ago[SelectionDAGBuilder] Remove redundant variable. NFCI.
Nirav Dave [Tue, 29 Jan 2019 15:14:07 +0000 (15:14 +0000)]
[SelectionDAGBuilder] Remove redundant variable. NFCI.

llvm-svn: 352506

5 years ago[llvm-objcopy] Implement --set-section-flags.
Jordan Rupprecht [Tue, 29 Jan 2019 15:05:38 +0000 (15:05 +0000)]
[llvm-objcopy] Implement --set-section-flags.

Summary:
--set-section-flags is used to change the section flags (e.g. SHF_ALLOC) for given sections. The flags allowed are the same from the existing --rename-section=.old=.new[,flags] feature.

Additionally, make sure that --set-section-flag cannot be used with --rename-section (either the source or destination), since --rename-section accepts flags. This avoids ambiguity for something like "--rename-section=.foo=.bar,alloc --set-section-flag=.bar,code".

Reviewers: jhenderson, jakehehrlich, alexshap, espindola

Reviewed By: jhenderson, jakehehrlich

Subscribers: llvm-commits, emaste, arichardson

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

llvm-svn: 352505

5 years agoReversing the checkin for version 352484 as tests are failing.
Ayonam Ray [Tue, 29 Jan 2019 15:00:50 +0000 (15:00 +0000)]
Reversing the checkin for version 352484 as tests are failing.

llvm-svn: 352504

5 years ago[Tooling] Handle #pragma once header guard in include insertion.
Eric Liu [Tue, 29 Jan 2019 14:40:01 +0000 (14:40 +0000)]
[Tooling] Handle #pragma once header guard in include insertion.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 352503