platform/upstream/llvm.git
5 years ago[xcodeproj] Add SBReproducer to LLDB.framework
Jonas Devlieghere [Thu, 21 Feb 2019 23:58:36 +0000 (23:58 +0000)]
[xcodeproj] Add SBReproducer to LLDB.framework

llvm-svn: 354637

5 years ago[gn] Add LLVM_BUILD_EXAMPLES.
Evgeniy Stepanov [Thu, 21 Feb 2019 23:56:05 +0000 (23:56 +0000)]
[gn] Add LLVM_BUILD_EXAMPLES.

llvm-svn: 354636

5 years ago[analyzer] MIGChecker: A checker for Mach Interface Generator conventions.
Artem Dergachev [Thu, 21 Feb 2019 23:55:28 +0000 (23:55 +0000)]
[analyzer] MIGChecker: A checker for Mach Interface Generator conventions.

This checker detects use-after-free bugs in (various forks of) the Mach kernel
that are caused by errors in MIG server routines - functions called remotely by
MIG clients. The MIG convention forces the server to only deallocate objects
it receives from the client when the routine is executed successfully.
Otherwise, if the server routine exits with an error, the client assumes that
it needs to deallocate the out-of-line data it passed to the server manually.
This means that deallocating such data within the MIG routine and then returning
a non-zero error code is always a dangerous use-after-free bug.

rdar://problem/35380337

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

llvm-svn: 354635

5 years agoAMDGPU: Remove debugger related subtarget features
Matt Arsenault [Thu, 21 Feb 2019 23:27:46 +0000 (23:27 +0000)]
AMDGPU: Remove debugger related subtarget features

As far as I know these aren't needed anymore.

llvm-svn: 354634

5 years agoUse _Q as MS ABI mangling for char8_t.
Richard Smith [Thu, 21 Feb 2019 23:04:35 +0000 (23:04 +0000)]
Use _Q as MS ABI mangling for char8_t.

Thanks to Yuriy Solodkyy for letting us know the mangling here.

llvm-svn: 354633

5 years ago[sanitizer] Common macro for .note.GNU-stack directives (NFC)
Evgeniy Stepanov [Thu, 21 Feb 2019 22:59:29 +0000 (22:59 +0000)]
[sanitizer] Common macro for .note.GNU-stack directives (NFC)

llvm-svn: 354632

5 years ago[Reproducers] Initialize reproducers before initializing the debugger.
Jonas Devlieghere [Thu, 21 Feb 2019 22:26:16 +0000 (22:26 +0000)]
[Reproducers] Initialize reproducers before initializing the debugger.

As per the discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20190218/048007.html

This commit implements option (3):

> Go back to initializing the reproducer before the rest of the debugger.
> The method wouldn't be instrumented and guarantee no other SB methods are
> called or SB objects are constructed. The initialization then becomes part
> of the replay.

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

llvm-svn: 354631

5 years ago[Kaleidoscope] Re-enable Kaleidoscope tests.
Lang Hames [Thu, 21 Feb 2019 22:24:53 +0000 (22:24 +0000)]
[Kaleidoscope] Re-enable Kaleidoscope tests.

These were disabled in r246267 (back in 2015). I suspect that the Win32 issues
that caused them to be disabled at the time have been resovlved, but if not
we can disable them again while we sort those out.

llvm-svn: 354630

5 years agoRevert "[asan] Fix vfork handling.", +1
Evgeniy Stepanov [Thu, 21 Feb 2019 22:02:24 +0000 (22:02 +0000)]
Revert "[asan] Fix vfork handling.", +1

Revert r354625, r354627 - multiple build failures.

llvm-svn: 354629

5 years ago[X86] Remove hasSideEffects=1 from the X87 pseudos with folded load.
Craig Topper [Thu, 21 Feb 2019 22:00:15 +0000 (22:00 +0000)]
[X86] Remove hasSideEffects=1 from the X87 pseudos with folded load.

This was done in r321424 to prevent scheduling from reordering things. But now that we model FPCW as a dependency, I don't think the same scheduling we were trying to prevent can occur.

llvm-svn: 354628

5 years ago[asan] Fix vfork handling.
Evgeniy Stepanov [Thu, 21 Feb 2019 21:55:06 +0000 (21:55 +0000)]
[asan] Fix vfork handling.

__asan_handle_vfork was unpoisoning the wrong part of the stack.
Adjust the test to catch this reliably (current failure is
non-deterministic).

llvm-svn: 354627

5 years ago[clang-cl] Whitelist -fbracket-depth=123 in clang-cl
Reid Kleckner [Thu, 21 Feb 2019 21:53:12 +0000 (21:53 +0000)]
[clang-cl] Whitelist -fbracket-depth=123 in clang-cl

Users apparently need it when expanding large quantities of macros.

Fixes PR38685

llvm-svn: 354626

5 years ago[hwasan,asan] Intercept vfork.
Evgeniy Stepanov [Thu, 21 Feb 2019 21:32:24 +0000 (21:32 +0000)]
[hwasan,asan] Intercept vfork.

Summary: AArch64 only for now.

Reviewers: vitalybuka, pcc

Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, jdoerfert, #sanitizers, llvm-commits, kcc

Tags: #sanitizers, #llvm

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

llvm-svn: 354625

5 years agoAMDGPU: Don't emit debugger subtarget features
Matt Arsenault [Thu, 21 Feb 2019 21:31:43 +0000 (21:31 +0000)]
AMDGPU: Don't emit debugger subtarget features

Keep the flag around for compatability.

llvm-svn: 354624

5 years ago[MemorySSA & LoopPassManager] Update MemorySSA in formDedicatedExitBlocks.
Alina Sbirlea [Thu, 21 Feb 2019 21:13:34 +0000 (21:13 +0000)]
[MemorySSA & LoopPassManager] Update MemorySSA in formDedicatedExitBlocks.

MemorySSA is now updated when forming dedicated exit blocks.
Resolves PR40037.

llvm-svn: 354623

5 years ago[Driver] Fix float ABI default for Android ARMv8.
Dan Albert [Thu, 21 Feb 2019 21:13:03 +0000 (21:13 +0000)]
[Driver] Fix float ABI default for Android ARMv8.

Summary: Android doesn't regress back to soft float after ARMv7 :)

Reviewers: srhines, pirama

Reviewed By: srhines, pirama

Subscribers: javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 354622

5 years ago[Fixed Point Arithmetic] Fixed Point Comparisons
Leonard Chan [Thu, 21 Feb 2019 20:50:09 +0000 (20:50 +0000)]
[Fixed Point Arithmetic] Fixed Point Comparisons

This patch implements fixed point comparisons with other fixed point types and
integers. This also provides constant expression evaluation for them.

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

llvm-svn: 354621

5 years agoAMDGPU/NFC: Cleanup subtarget predicates
Konstantin Zhuravlyov [Thu, 21 Feb 2019 20:43:43 +0000 (20:43 +0000)]
AMDGPU/NFC: Cleanup subtarget predicates

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

llvm-svn: 354620

5 years ago[x86] vectorize more cast ops in lowering to avoid register file transfers
Sanjay Patel [Thu, 21 Feb 2019 20:40:39 +0000 (20:40 +0000)]
[x86] vectorize more cast ops in lowering to avoid register file transfers

This is a follow-up to D56864.

If we're extracting from a non-zero index before casting to FP,
then shuffle the vector and optionally narrow the vector before doing the cast:

cast (extelt V, C) --> extelt (cast (extract_subv (shuffle V, [C...]))), 0

This might be enough to close PR39974:
https://bugs.llvm.org/show_bug.cgi?id=39974

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

llvm-svn: 354619

5 years ago[gn] Add target flags to asmflags.
Evgeniy Stepanov [Thu, 21 Feb 2019 20:35:31 +0000 (20:35 +0000)]
[gn] Add target flags to asmflags.

Reviewers: pcc, thakis

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 354618

5 years ago[lldb] [test] Do not link -ldl on NetBSD
Michal Gorny [Thu, 21 Feb 2019 20:28:21 +0000 (20:28 +0000)]
[lldb] [test] Do not link -ldl on NetBSD

Fix the load_* using test Makefiles not to link -ldl on NetBSD.
There is no such a library on NetBSD, and dlopen() is available
without a library.  Quoting the manpage:

    (These functions are not in a library.  They are included in every
    dynamically linked program automatically.)

To resolve this portably, introduce a new USE_LIBDL option.  If it set
to 1, Makefile.rules automatically appends -ldl on platforms needing it.

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

llvm-svn: 354617

5 years agoRe-land "[AArch64][GlobalISel] Implement partial support for G_SHUFFLE_VECTOR""
Amara Emerson [Thu, 21 Feb 2019 20:20:16 +0000 (20:20 +0000)]
Re-land "[AArch64][GlobalISel] Implement partial support for G_SHUFFLE_VECTOR""

Thanks to Richard Trieu for pointing out that the failures were due to a
use-after-free of an ArrayRef.

llvm-svn: 354616

5 years ago[HIP] change kernel stub name
Yaxun Liu [Thu, 21 Feb 2019 20:12:16 +0000 (20:12 +0000)]
[HIP] change kernel stub name

Add .stub to kernel stub function name so that it is different from kernel
name in device code. This is necessary to let debugger find correct symbol
for kernel

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

llvm-svn: 354615

5 years ago[llvm] Fix typo: 's/ ot / to /' [NFC]
Mandeep Singh Grang [Thu, 21 Feb 2019 20:04:20 +0000 (20:04 +0000)]
[llvm] Fix typo: 's/ ot / to /' [NFC]

llvm-svn: 354614

5 years ago[LoopSimplifyCFG] Update MemorySSA after r353911.
Alina Sbirlea [Thu, 21 Feb 2019 19:54:05 +0000 (19:54 +0000)]
[LoopSimplifyCFG] Update MemorySSA after r353911.

Summary:
MemorySSA is not properly updated in LoopSimplifyCFG after recent changes. Use SplitBlock utility to resolve that and clear all updates once handleDeadExits is finished.
All updates that follow are removal of edges which are safe to handle via the removeEdge() API.
Also, deleting dead blocks is done correctly as is, i.e. delete from MemorySSA before updating the CFG and DT.

Reviewers: mkazantsev, rtereshin

Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits

Tags: #llvm

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

llvm-svn: 354613

5 years ago[EarlyCSE] Cleanup deadcode. [NFCI]
Alina Sbirlea [Thu, 21 Feb 2019 19:49:57 +0000 (19:49 +0000)]
[EarlyCSE] Cleanup deadcode. [NFCI]

Summary: Cleanup nop assignments.

Reviewers: george.burgess.iv, davide

Subscribers: sanjoy, jlebar, llvm-commits

Tags: #llvm

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

llvm-svn: 354612

5 years ago[Hexagon] Use misaligned load instead of trap0(#0) for __builtin_trap
Krzysztof Parzyszek [Thu, 21 Feb 2019 19:42:39 +0000 (19:42 +0000)]
[Hexagon] Use misaligned load instead of trap0(#0) for __builtin_trap

The trap instruction is intercepted by various runtime environments,
and instead of a crash it creates confusion.

This reapplies r354606 with a fix.

llvm-svn: 354611

5 years ago[CodeGen] Fix string literal address space casting.
Michael Liao [Thu, 21 Feb 2019 19:40:20 +0000 (19:40 +0000)]
[CodeGen] Fix string literal address space casting.

Summary:
- If a string literal is reused directly, need to add necessary address
  space casting if the target requires that.

Reviewers: yaxunl

Subscribers: jvesely, cfe-commits

Tags: #clang

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

llvm-svn: 354610

5 years agoRevert r354606, it breaks asan tests
Krzysztof Parzyszek [Thu, 21 Feb 2019 19:33:58 +0000 (19:33 +0000)]
Revert r354606, it breaks asan tests

llvm-svn: 354609

5 years ago[test] Fix typo: 's/ ot / to /' [NFC]
Mandeep Singh Grang [Thu, 21 Feb 2019 19:11:15 +0000 (19:11 +0000)]
[test] Fix typo: 's/ ot / to /' [NFC]

llvm-svn: 354608

5 years agoELF: Remove dead code. NFCI.
Peter Collingbourne [Thu, 21 Feb 2019 18:53:58 +0000 (18:53 +0000)]
ELF: Remove dead code. NFCI.

RelocationBaseSection is not used in -r links, so Config->Relocatable will
always be false.

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

llvm-svn: 354607

5 years ago[Hexagon] Use misaligned load instead of trap0(#0) for __builtin_trap
Krzysztof Parzyszek [Thu, 21 Feb 2019 18:39:22 +0000 (18:39 +0000)]
[Hexagon] Use misaligned load instead of trap0(#0) for __builtin_trap

The trap instruction is intercepted by various runtime environments,
and instead of a crash it creates confusion.

llvm-svn: 354606

5 years agoUpdate `ld.lld --version` string for monorepo.
Rui Ueyama [Thu, 21 Feb 2019 18:37:26 +0000 (18:37 +0000)]
Update `ld.lld --version` string for monorepo.

This patch basically does the same thing as
https://reviews.llvm.org/rL352729 did to clang.

With this patch, lld now prints out a correct version string including
a git commit id like this:

  $ bin/ld.lld --version
  LLD 9.0.0 (https://github.com/llvm/llvm-project.git c027658504fa9e68173f53dedaf223695a65e910) (compatible with GNU linkers)

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

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

llvm-svn: 354605

5 years ago[AMDGPU] remove unused AssemblerPredicates
Mark Searles [Thu, 21 Feb 2019 18:19:54 +0000 (18:19 +0000)]
[AMDGPU] remove unused AssemblerPredicates

An internal build is hitting asserts complaining about too many subtarget
features:
  llvm/utils/TableGen/Types.cpp:42:
    const char* llvm::getMinimalTypeForEnumBitfield(uint64_t):
    Assertion `MaxIndex <= 64 && "Too many bits"' failed.

  llvm/utils/TableGen/AsmMatcherEmitter.cpp:1476:
    void {anonymous}::AsmMatcherInfo::buildInfo():
    Assertion `SubtargetFeatures.size() <= 64 && "Too many subtarget features!"'
    failed.

The short-term solution is to remove a few unused AssemblerPredicates to get
under the limit.

The long-term solution seems to be to revisit these asserts. E.g., rather than
hardcoded '64', use the standard sized std::bitset like the other places that
track subtarget features.

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

llvm-svn: 354604

5 years ago[llvm-objcopy][NFC] Add std::move() to fix older BB
Jordan Rupprecht [Thu, 21 Feb 2019 17:24:55 +0000 (17:24 +0000)]
[llvm-objcopy][NFC] Add std::move() to fix older BB

llvm-svn: 354603

5 years ago[unittest] Fix missing user-provided default constructor
Jonas Devlieghere [Thu, 21 Feb 2019 17:18:06 +0000 (17:18 +0000)]
[unittest] Fix missing user-provided default constructor

error: default initialization of an object of const type 'const Pod'
without a user-provided default constructor

llvm-svn: 354602

5 years agoRevert "[sanitizers] Restore internal_readlink for x32"
Matt Morehouse [Thu, 21 Feb 2019 17:06:23 +0000 (17:06 +0000)]
Revert "[sanitizers] Restore internal_readlink for x32"

This reverts r354451 since it broke the Windows sanitizer bot.

llvm-svn: 354601

5 years ago[llvm-objcopy][NFC] More error cleanup
Jordan Rupprecht [Thu, 21 Feb 2019 17:05:19 +0000 (17:05 +0000)]
[llvm-objcopy][NFC] More error cleanup

Summary:
This removes calls to `error()`/`reportError()` in the main driver (llvm-objcopy.cpp) as well as the associated argv-parsing (CopyConfig.cpp). `logAllUnhandledErrors()` is now the main way to print errors.

There are still a few uses from within the per-arch drivers, so we can't delete them yet... but almost!

Reviewers: jhenderson, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, jakehehrlich, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 354600

5 years ago[WebAssembly] Don't create MSSymbolWasm object for non-symbols
Sam Clegg [Thu, 21 Feb 2019 17:05:19 +0000 (17:05 +0000)]
[WebAssembly] Don't create MSSymbolWasm object for non-symbols

`__linear_memory` and `__indirect_function_table` are both generated
as imports in wasm object files but are actually symbols and don't
appear in any symbols table or relocation entry.  Indeed we
don't have any symbol type to meaningfully represent either of them.

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

llvm-svn: 354599

5 years ago[Kaleidoscope] Fix symbol resolver to search in reverse order.
Lang Hames [Thu, 21 Feb 2019 16:53:04 +0000 (16:53 +0000)]
[Kaleidoscope] Fix symbol resolver to search in reverse order.

This should allow more recent definitions of functions in the Kaleidoscope REPL
to override old ones, as the tutorial text promises.

llvm-svn: 354598

5 years ago[llvm-objcopy] Make removeSectionReferences batched
Jordan Rupprecht [Thu, 21 Feb 2019 16:45:42 +0000 (16:45 +0000)]
[llvm-objcopy] Make removeSectionReferences batched

Summary:
Removing a large number of sections from a file with a lot of symbols can have abysmal (i.e. O(n^2)) performance, e.g. when running `--only-section` to extract one section out of a large file.

This comes from iterating over all symbols in the symbol table each time we remove a section, to remove references to the section we just removed.
Instead, do just one pass of symbol removal by passing a hash set of all the sections we'd like to remove references to.

This fixes a regression when running llvm-objcopy -j <one section> on an object file with many sections and symbols -- on my machine, running `objcopy -j .keep_me huge-input.o /tmp/foo.o` takes .3s with GNU objcopy, 1.3s with an updated llvm-objcopy, and 7+ minutes with llvm-objcopy prior to this patch.

Reviewers: MaskRay, jhenderson, jakehehrlich, alexshap, espindola

Reviewed By: MaskRay, jhenderson

Subscribers: echristo, emaste, arichardson, mgrang, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 354597

5 years agoRevert "[CUDA]Delayed diagnostics for the asm instructions."
Alexey Bataev [Thu, 21 Feb 2019 16:40:21 +0000 (16:40 +0000)]
Revert "[CUDA]Delayed diagnostics for the asm instructions."

This reverts commit r354593 to fix the problem with the crash on
windows.

llvm-svn: 354596

5 years ago[PPC] Add store merging testcase.
Nirav Dave [Thu, 21 Feb 2019 16:34:48 +0000 (16:34 +0000)]
[PPC] Add store merging testcase.

llvm-svn: 354595

5 years ago[DAGCombiner] prevent infinite looping by truncating 'and' (PR40793)
Sanjay Patel [Thu, 21 Feb 2019 16:01:48 +0000 (16:01 +0000)]
[DAGCombiner] prevent infinite looping by truncating 'and' (PR40793)

This fold can occur during legalization, so it can fight with promotion
to the larger type. It apparently takes a special sequence and subtarget
to avoid more basic simplifications that would hide the problem.

But there's a bigger question raised here: why does distributeTruncateThroughAnd()
even exist? It duplicates functionality from a more minimal pattern that we
already have. But getting rid of this function requires some preliminary steps.

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

llvm-svn: 354594

5 years ago[CUDA]Delayed diagnostics for the asm instructions.
Alexey Bataev [Thu, 21 Feb 2019 15:51:30 +0000 (15:51 +0000)]
[CUDA]Delayed diagnostics for the asm instructions.

Summary:
Adapted targetDiag for the CUDA and used for the delayed diagnostics in
asm constructs. Works for both host and device compilation sides.

Reviewers: tra, jlebar

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354593

5 years agoAMDGPU/GlobalISel: Make phis legal
Matt Arsenault [Thu, 21 Feb 2019 15:48:13 +0000 (15:48 +0000)]
AMDGPU/GlobalISel: Make phis legal

llvm-svn: 354592

5 years agoRegBankSelect: Allow targets to introduce control flow for mapping
Matt Arsenault [Thu, 21 Feb 2019 15:48:13 +0000 (15:48 +0000)]
RegBankSelect: Allow targets to introduce control flow for mapping

For AMDGPU, if an operand requires an SGPR but is only available as a
VGPR, a loop needs to be introduced to execute the instruction with
each unique combination of values across all lanes. The rest of the
instructions in the block will be moved to a new block following the
loop. Check if the next instruction's parent changed, and update the
iterators and insertion block if this happened.

Tests will be included in a future patch.

llvm-svn: 354591

5 years agoFix missing C++ mode comments
Matt Arsenault [Thu, 21 Feb 2019 15:48:10 +0000 (15:48 +0000)]
Fix missing C++ mode comments

llvm-svn: 354590

5 years ago[x86] regenerate checks; NFC
Sanjay Patel [Thu, 21 Feb 2019 15:30:28 +0000 (15:30 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 354589

5 years ago[X86] Fix copy-paste error in @ccz flag.
Nirav Dave [Thu, 21 Feb 2019 15:28:31 +0000 (15:28 +0000)]
[X86] Fix copy-paste error in @ccz flag.

@ccz operand should be equivalent to @cce.

llvm-svn: 354588

5 years agoAMDGPU/GlobalISel: Fix bit count ops for non-power-of-2 types
Matt Arsenault [Thu, 21 Feb 2019 15:22:20 +0000 (15:22 +0000)]
AMDGPU/GlobalISel: Fix bit count ops for non-power-of-2 types

llvm-svn: 354587

5 years ago[llvm-readobj] Weaken a check in the test added by r354567
Ilya Biryukov [Thu, 21 Feb 2019 14:51:17 +0000 (14:51 +0000)]
[llvm-readobj] Weaken a check in the test added by r354567

The check includes a substring, configurable by PACKAGE_NAME in CMake.
This leads to failures if PACKAGE_NAME is not the default.

llvm-svn: 354586

5 years ago[clangd] Only report explicitly typed symbols during code navigation
Kadir Cetinkaya [Thu, 21 Feb 2019 14:48:33 +0000 (14:48 +0000)]
[clangd] Only report explicitly typed symbols during code navigation

Summary:
Clangd was reporting implicit symbols, like results of implicit cast
expressions during code navigation, which is not desired. For example:

```
struct Foo{ Foo(int); };
void bar(Foo);
vod foo() {
  int x;
  bar(^x);
}
```
Performing a GoTo on the point specified by ^ would give two results one
pointing to line `int x` and the other for definition of `Foo(int);`

Reviewers: ilya-biryukov, sammccall

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

Tags: #clang

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

llvm-svn: 354585

5 years ago[RISCV][NFC] IsEligibleForTailCallOptimization -> isEligibleForTailCallOptimization
Alex Bradbury [Thu, 21 Feb 2019 14:31:41 +0000 (14:31 +0000)]
[RISCV][NFC] IsEligibleForTailCallOptimization -> isEligibleForTailCallOptimization

Also clang-format the modified hunks.

llvm-svn: 354584

5 years ago[RISCV] Add implied zero offset load/store alias patterns
Alex Bradbury [Thu, 21 Feb 2019 14:09:34 +0000 (14:09 +0000)]
[RISCV] Add implied zero offset load/store alias patterns

Allow load/store instructions with implied zero offset for compatibility with
GNU assembler.

Differential Revision: https://reviews.llvm.org/D57141
Patch by James Clarke.

llvm-svn: 354581

5 years ago[InferAddressSpaces] Fix fallthrough error
Joey Gouly [Thu, 21 Feb 2019 13:10:37 +0000 (13:10 +0000)]
[InferAddressSpaces] Fix fallthrough error

llvm-svn: 354580

5 years ago[ARM GlobalISel] Support G_FRAME_INDEX for Thumb2
Diana Picus [Thu, 21 Feb 2019 13:00:02 +0000 (13:00 +0000)]
[ARM GlobalISel] Support G_FRAME_INDEX for Thumb2

Same as arm mode.

llvm-svn: 354579

5 years agoRe-land part of r354244 "[DAGCombiner] Eliminate dead stores to stack."
Clement Courbet [Thu, 21 Feb 2019 12:59:36 +0000 (12:59 +0000)]
Re-land part of r354244 "[DAGCombiner] Eliminate dead stores to stack."

This part introduces the lifetime node.

llvm-svn: 354578

5 years ago[llvm-readobj]Add testing for ELF symbol and section table printing for a wider range...
James Henderson [Thu, 21 Feb 2019 12:47:10 +0000 (12:47 +0000)]
[llvm-readobj]Add testing for ELF symbol and section table printing for a wider range of values

The existing ELF symbol and section table testing doesn't test many of
the corner-cases or valid values for various ELF properties, including
things like binding, visibility, section type and so on. This patch adds
a series of tests that test these and other related edge-cases.

Reviewed by: grimar, MaskRay

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

llvm-svn: 354577

5 years ago[InferAddressSpaces] Fix crash on select of non-ptr operands
Joey Gouly [Thu, 21 Feb 2019 12:31:36 +0000 (12:31 +0000)]
[InferAddressSpaces] Fix crash on select of non-ptr operands

Check the operands of a select are pointers, to determine if it is an address
expression or not.

https://reviews.llvm.org/D58226

llvm-svn: 354576

5 years ago[X86][SSE] combineX86ShufflesRecursively - moved to generic op input index lookup...
Simon Pilgrim [Thu, 21 Feb 2019 12:24:49 +0000 (12:24 +0000)]
[X86][SSE] combineX86ShufflesRecursively - moved to generic op input index lookup. NFCI.

We currently bail if the target shuffle decodes to more than 2 input vectors, this change alters the input index to work for any number of inputs for when we drop that requirement.

llvm-svn: 354575

5 years ago[yaml2obj][obj2yaml] - Support SHT_GNU_verdef (.gnu.version_d) section.
George Rimar [Thu, 21 Feb 2019 12:21:43 +0000 (12:21 +0000)]
[yaml2obj][obj2yaml] - Support SHT_GNU_verdef (.gnu.version_d) section.

This patch adds support for parsing/dumping the .gnu.version section.

Description of the section is: https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverdefs.html

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

llvm-svn: 354574

5 years ago[LLD][ELF] - Simplify test case. NFC.
George Rimar [Thu, 21 Feb 2019 12:18:22 +0000 (12:18 +0000)]
[LLD][ELF] - Simplify test case. NFC.

It has an excessive section declaration.

llvm-svn: 354573

5 years ago[OpenMP] Fix check-openmp after r354553
Jonas Hahnfeld [Thu, 21 Feb 2019 12:00:57 +0000 (12:00 +0000)]
[OpenMP] Fix check-openmp after r354553

Calling add_openmp_testsuite will add the tests to check-openmp unless
EXCLUDE_FROM_ALL is set. This is problematic because the tests for OMPT
will be included twice which doesn't work if the same test is executed
concurrently by multiple threads.

See:
http://lab.llvm.org:8011/builders/openmp-gcc-x86_64-linux-debian/builds/163
http://lab.llvm.org:8011/builders/openmp-clang-x86_64-linux-debian/builds/184

http://lab.llvm.org:8011/builders/openmp-clang-ppc64le-linux-rhel/builds/133
(On PPC some failures are unrelated to r354553, the bot has been red before
and this commit is not expected to fix that. For a proper patch please see
https://reviews.llvm.org/D56286.)

llvm-svn: 354572

5 years ago[llvm-readobj] Change "SHT_MIPS_DWARF" to "MIPS_DWARF"
Fangrui Song [Thu, 21 Feb 2019 11:35:41 +0000 (11:35 +0000)]
[llvm-readobj] Change "SHT_MIPS_DWARF" to "MIPS_DWARF"

Summary:
This is to be consistent with the display of other MIPS section types.
This string is also used by binutils-gdb/binutils/readelf.c:get_mips_section_type_name

Since we are here, reorder the two enum constatns because SHT_MIPS_DWARF < SHT_MIPS_ABIFLAGS.

Reviewers: jhenderson, atanasyan

Reviewed By: jhenderson

Subscribers: aprantl, sdardis, arichardson, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 354571

5 years ago[CodeComplete] Collect visited contexts when scope specifier is invalid.
Eric Liu [Thu, 21 Feb 2019 11:22:58 +0000 (11:22 +0000)]
[CodeComplete] Collect visited contexts when scope specifier is invalid.

Summary:
This will allow completion consumers to guess the specified scope by
putting together scopes in the context with the specified scope (e.g. when the
specified namespace is not imported yet).

Reviewers: ilya-biryukov

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354570

5 years agoRevert 354564: [ARM] Add some missing thumb1 opcodes to enable peephole optimisation...
David Green [Thu, 21 Feb 2019 11:03:13 +0000 (11:03 +0000)]
Revert 354564: [ARM] Add some missing thumb1 opcodes to enable peephole optimisation of CMPs

I believe it's causing bootstrap failures for A32 code. I'll take a look at
what's wrong.

llvm-svn: 354569

5 years ago[OpenCL] Simplify LLVM IR generated for OpenCL blocks
Andrew Savonichev [Thu, 21 Feb 2019 11:02:10 +0000 (11:02 +0000)]
[OpenCL] Simplify LLVM IR generated for OpenCL blocks

Summary:
Emit direct call of block invoke functions when possible, i.e. in case the
block is not passed as a function argument.
Also doing some refactoring of `CodeGenFunction::EmitBlockCallExpr()`

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 354568

5 years ago[llvm-readobj]Test basic command-line handling
James Henderson [Thu, 21 Feb 2019 11:00:29 +0000 (11:00 +0000)]
[llvm-readobj]Test basic command-line handling

There was no real testing for llvm-readobj/llvm-readelf's behaviour
under various bad inputs and command-line switches. This patch adds some
testing of this, along with basic testing of --version and --help.

Reviewed by: MaskRay, grimar

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

llvm-svn: 354567

5 years ago[yaml2obj]Allow symbol Index field to take values lower than SHN_LORESERVE
James Henderson [Thu, 21 Feb 2019 10:57:15 +0000 (10:57 +0000)]
[yaml2obj]Allow symbol Index field to take values lower than SHN_LORESERVE

In order to test tool handling of invalid section indexes, I need to
create an object containing such an invalid section index. I could
create a hex-edited binary, but having the ability to use yaml2obj is
preferable. Prior to this change, yaml2obj would reject any explicit
section indexes less than SHN_LORESERVE. This patch changes it to allow
any value.

I had to change the test to use llvm-readelf instead of llvm-readobj,
because llvm-readobj does not like invalid section indexes. I've also
expanded the test to show that the most common SHN_* values are accepted
(SHN_UNDEF, SHN_ABS, SHN_COMMON).

Reviewed by: grimar, jakehehrlich

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

llvm-svn: 354566

5 years ago[AArch64] Print instruction before atomic semantic annotations
David Spickett [Thu, 21 Feb 2019 10:42:49 +0000 (10:42 +0000)]
[AArch64] Print instruction before atomic semantic annotations

Commit r353303 added annotations when acquire semantics
were dropped from an instruction.

printAnnotation was called before printInstruction.
So if you didn't set a separate comment output stream
you got <comment><instr> instead of <instr><comment>
as expected.

To fix this move the new printAnnotation to after
the instruction is printed.

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

llvm-svn: 354565

5 years ago[ARM] Add some missing thumb1 opcodes to enable peephole optimisation of CMPs
David Green [Thu, 21 Feb 2019 10:30:09 +0000 (10:30 +0000)]
[ARM] Add some missing thumb1 opcodes to enable peephole optimisation of CMPs

This adds a number of missing Thumb1 opcodes so that the peephole optimiser can
remove redundant CMP instructions.

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

llvm-svn: 354564

5 years ago[ObjectYAML] Support SHT_MIPS_DWARF section type flag
Fangrui Song [Thu, 21 Feb 2019 10:19:08 +0000 (10:19 +0000)]
[ObjectYAML] Support SHT_MIPS_DWARF section type flag

Also reorder SHT_MIPS_DWARF and SHT_MIPS_ABIFLAGS in Object/ELF.cpp.
The test will be added by D58457.

llvm-svn: 354563

5 years ago[NFC] Replace EOL in test file
Max Kazantsev [Thu, 21 Feb 2019 09:56:23 +0000 (09:56 +0000)]
[NFC] Replace EOL in test file

llvm-svn: 354562

5 years ago[clangd] Enable indexing of template type parameters
Kadir Cetinkaya [Thu, 21 Feb 2019 09:55:00 +0000 (09:55 +0000)]
[clangd] Enable indexing of template type parameters

Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=36285

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 354561

5 years ago[clang][Index] Enable indexing of Template Type Parameters behind a flag
Kadir Cetinkaya [Thu, 21 Feb 2019 09:52:33 +0000 (09:52 +0000)]
[clang][Index] Enable indexing of Template Type Parameters behind a flag

Summary:
clangd uses indexing api to provide references and it was not possible
to perform symbol information for template parameters. This patch enables
visiting of TemplateTypeParmTypeLocs.

Reviewers: ilya-biryukov, akyrtzi

Subscribers: javed.absar, kristof.beyls, ioeric, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354560

5 years ago[TEST] Add failing test that shows problems with MSSA update in LoopSimplifyCFG
Max Kazantsev [Thu, 21 Feb 2019 09:40:24 +0000 (09:40 +0000)]
[TEST] Add failing test that shows problems with MSSA update in LoopSimplifyCFG

llvm-svn: 354559

5 years ago[clangd] Handle another incomplete-type diagnostic case in IncludeFixer.
Eric Liu [Thu, 21 Feb 2019 09:33:49 +0000 (09:33 +0000)]
[clangd] Handle another incomplete-type diagnostic case in IncludeFixer.

llvm-svn: 354558

5 years ago[ARM] Negative constants mishandled in ARM CGP
Sam Parker [Thu, 21 Feb 2019 09:33:18 +0000 (09:33 +0000)]
[ARM] Negative constants mishandled in ARM CGP

During type promotion, sometimes we convert negative an add with a
negative constant into a sub with a positive constant. The loop that
performs this transformation has two issues:
- it iterates over a set, causing non-determinism.
- it breaks, instead of continuing, when it finds the first
  non-negative operand.

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

llvm-svn: 354557

5 years agotestsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir
Jan Kratochvil [Thu, 21 Feb 2019 09:05:27 +0000 (09:05 +0000)]
testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir

Getting failure when building in a directory which is symlinked elsewhere:

Failing Tests (1):
    lldb-Suite :: functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
    lldb-Suite :: source-manager/TestSourceManager.py

For TestCompDirSymLink:
------------------------------------------------------------------------------
runCmd: file .../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/CompDirSymLink
output: Current executable set to '.../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/CompDirSymLink' (x86_64).
runCmd: settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd
output: None
runCmd: breakpoint set -f ".../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/relative.cpp" -l 11
output: Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.

It is because /proc/self/cwd (used above for plugin.symbol-file.dwarf.comp-dir-symlink-paths) points to an already resolved directory:

(cd /tmp;mkdir real;ln -s real symlink;cd symlink;ls -l /proc/self/cwd)
lrwxrwxrwx 1 jkratoch jkratoch 0 Feb 20 19:55 /proc/self/cwd -> /tmp/real/
------------------------------------------------------------------------------

For TestSourceManager the resolving is done by 'make -C' as found by Pavel Labath.

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

llvm-svn: 354556

5 years ago[OpenMP][OMPT] Fix locking testcases for 32 bit architectures
Joachim Protze [Thu, 21 Feb 2019 08:50:49 +0000 (08:50 +0000)]
[OpenMP][OMPT] Fix locking testcases for 32 bit architectures

Fix for the bug reported in:
https://bugs.llvm.org/show_bug.cgi?id=40531

The address is now casted the same way as in the runtime code.

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

llvm-svn: 354553

5 years ago[DebugInfo] Prep llvm-dwarfdump for typed DW5 ops.
Markus Lavin [Thu, 21 Feb 2019 08:20:24 +0000 (08:20 +0000)]
[DebugInfo] Prep llvm-dwarfdump for typed DW5 ops.

Adds llvm-dwarfdump support for pretty printing Dwarf5 expressions ops
that reference a base type (right now only DW_OP_convert is added).
Includes verification to verify that the ops operand is actually a
DW_TAG_base_type DIE.

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

llvm-svn: 354552

5 years agoFix file header issues in fuzzers. NFC
Fangrui Song [Thu, 21 Feb 2019 07:57:14 +0000 (07:57 +0000)]
Fix file header issues in fuzzers. NFC

llvm-svn: 354551

5 years agoFix some include order and file headers issues. NFC
Fangrui Song [Thu, 21 Feb 2019 07:42:31 +0000 (07:42 +0000)]
Fix some include order and file headers issues. NFC

llvm-svn: 354550

5 years agoRevert r354546
Serge Guelton [Thu, 21 Feb 2019 06:59:21 +0000 (06:59 +0000)]
Revert r354546

This triggers an ICE on gcc 7, see http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17598/steps/build%20stage%201/logs/stdio

llvm-svn: 354549

5 years agoFix typo in r354546
Serge Guelton [Thu, 21 Feb 2019 06:12:41 +0000 (06:12 +0000)]
Fix typo in r354546

llvm-svn: 354548

5 years ago[LoopSimplifyCFG] Add missing MSSA edge deletion
Max Kazantsev [Thu, 21 Feb 2019 05:51:29 +0000 (05:51 +0000)]
[LoopSimplifyCFG] Add missing MSSA edge deletion

When we create fictive switch in preheader, we should take
care about MSSA and delete edge between old preheader and
header.

llvm-svn: 354547

5 years ago[NFC] Always initialize all members in ABIArgInfo
Serge Guelton [Thu, 21 Feb 2019 04:55:50 +0000 (04:55 +0000)]
[NFC] Always initialize all members in ABIArgInfo

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

llvm-svn: 354546

5 years agoAttempt to fix VS2015 build breakage from r354517. NFCI.
Douglas Yung [Thu, 21 Feb 2019 04:55:31 +0000 (04:55 +0000)]
Attempt to fix VS2015 build breakage from r354517. NFCI.

llvm-svn: 354545

5 years ago[WebAssembly] Default to something reasonable in WebAssemblyAddMissingPrototypes
Sam Clegg [Thu, 21 Feb 2019 03:27:00 +0000 (03:27 +0000)]
[WebAssembly] Default to something reasonable in WebAssemblyAddMissingPrototypes

Previously if we couldn't derive a prototype for a "no-prototype"
function from C we would leave it as is:

  void foo(...)

With this change we instead give is an empty signature and remove
the "no-prototype" attribute.

This fixes the current wasm waterfall test failure.

Tags: #llvm

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

llvm-svn: 354544

5 years ago[AMDGPU] fix commuted case of sub combine
Stanislav Mekhanoshin [Thu, 21 Feb 2019 02:58:00 +0000 (02:58 +0000)]
[AMDGPU] fix commuted case of sub combine

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

llvm-svn: 354543

5 years ago[Inliner] Pass nullptr for the ORE param of getInlineCost if RemarkEnabled
Wei Mi [Thu, 21 Feb 2019 02:57:52 +0000 (02:57 +0000)]
[Inliner] Pass nullptr for the ORE param of getInlineCost if RemarkEnabled
is false.

Right now for inliner and partial inliner, we always pass the address of a
valid ORE object to getInlineCost even if RemarkEnabled is false because of
no -Rpass is specified. Since ComputeFullInlineCost will be set to true if
ORE is non-null in getInlineCost, this introduces the problem that in
getInlineCost we cannot return early even if we already know the cost is
definitely higher than the threshold. It is a general problem for compile
time.

This patch fixes that by pass nullptr as the ORE argument if RemarkEnabled is
false.

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

llvm-svn: 354542

5 years agoAdd skipFunction to PostRA machine sinking pass.
Xin Tong [Thu, 21 Feb 2019 02:11:06 +0000 (02:11 +0000)]
Add skipFunction to PostRA machine sinking pass.

Summary: Add skipFunction to PostRA machine sinking pass.

Reviewers: junbuml

Subscribers: arsenm, llvm-commits

Tags: #llvm

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

llvm-svn: 354541

5 years agoRevert "[lldb-mi] Move TestMIPrompt away from pexpect()."
Davide Italiano [Thu, 21 Feb 2019 01:55:31 +0000 (01:55 +0000)]
Revert "[lldb-mi] Move TestMIPrompt away from pexpect()."

I see a test failing on the macOS bots. I can't reproduce
locally, so try to get the bots green before I can investigate.

llvm-svn: 354540

5 years ago[WebAssembly] Remove redundant code added in rL354538. NFC.
Sam Clegg [Thu, 21 Feb 2019 01:33:26 +0000 (01:33 +0000)]
[WebAssembly] Remove redundant code added in rL354538. NFC.

The code for encoding the symbols signature into its name
was not actually being used in the final version of this change.

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

llvm-svn: 354539

5 years ago[AArch64] Change size suffix for FP16FML intrinsics.
Ahmed Bougacha [Thu, 21 Feb 2019 01:13:27 +0000 (01:13 +0000)]
[AArch64] Change size suffix for FP16FML intrinsics.

These currently use _u32, but they should instead use _f16, the
types of the multiplication (matching the various integer vmlal
variants).

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

llvm-svn: 354538

5 years ago[NFC] Fix incorrect comment in std::function test
Louis Dionne [Thu, 21 Feb 2019 00:53:26 +0000 (00:53 +0000)]
[NFC] Fix incorrect comment in std::function test

llvm-svn: 354537

5 years ago[libFuzzer] fix the docs
Kostya Serebryany [Thu, 21 Feb 2019 00:43:46 +0000 (00:43 +0000)]
[libFuzzer] fix the docs

llvm-svn: 354536

5 years agoFix unused variable warning.
Richard Trieu [Thu, 21 Feb 2019 00:36:14 +0000 (00:36 +0000)]
Fix unused variable warning.

llvm-svn: 354535

5 years ago[clang-tidy] Make google-objc-function-naming ignore implicit functions 🙈
Stephane Moore [Thu, 21 Feb 2019 00:34:01 +0000 (00:34 +0000)]
[clang-tidy] Make google-objc-function-naming ignore implicit functions ðŸ™ˆ

Summary:
Implicit functions are outside the control of source authors and should
be exempt from style restrictions.

Tested via running clang tools tests.

This is an amended followup to https://reviews.llvm.org/D57207

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: jdoerfert, xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 354534