OSDN Git Service

android-x86/external-llvm.git
5 years ago[X86] Use ANY_EXTEND instead of SIGN_EXTEND in the AVX2 and later path for legalizing...
Craig Topper [Fri, 16 Nov 2018 01:16:59 +0000 (01:16 +0000)]
[X86] Use ANY_EXTEND instead of SIGN_EXTEND in the AVX2 and later path for legalizing vXi8 multiply.

We aren't going to use the upper bits of the multiply result that the extend would effect. So we don't need a specific type of extend.

This makes some reduction test cases shorter because we were previously trying to sign_extend a truncate which we can't eliminate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347011 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Update a couple comments to remove a mention of a sign extending that no longer...
Craig Topper [Fri, 16 Nov 2018 01:16:51 +0000 (01:16 +0000)]
[X86] Update a couple comments to remove a mention of a sign extending that no longer happens. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347010 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VFS] Implement `RedirectingFileSystem::getRealPath`.
Volodymyr Sapsai [Fri, 16 Nov 2018 01:15:54 +0000 (01:15 +0000)]
[VFS] Implement `RedirectingFileSystem::getRealPath`.

It fixes the case when Objective-C framework is added as a subframework
through a symlink. When parent framework infers a module map and fails
to detect a symlink, it would add a subframework as a submodule. And
when we parse module map for the subframework, we would encounter an
error like

> error: umbrella for module 'WithSubframework.Foo' already covers this directory

By implementing `getRealPath` "an egregious but useful hack" in
`ModuleMap::inferFrameworkModule` works as expected.

rdar://problem/45821279

Reviewers: bruno, benlangmuir, erik.pilkington

Reviewed By: bruno

Subscribers: hiraditya, dexonsmith, JDevlieghere, cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347009 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Add FixupVectorISel pass, currently Supports SREGs in GLOBAL LD/ST
Ron Lieberman [Fri, 16 Nov 2018 01:13:34 +0000 (01:13 +0000)]
[AMDGPU] Add FixupVectorISel pass, currently Supports SREGs in GLOBAL LD/ST

Add a pass to fixup various vector ISel issues.
Currently we handle converting GLOBAL_{LOAD|STORE}_*
and GLOBAL_Atomic_* instructions into their _SADDR variants.
This involves feeding the sreg into the saddr field of the new instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347008 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CUDA] updated CompileCudaWithLLVM.rst
Artem Belevich [Fri, 16 Nov 2018 01:02:43 +0000 (01:02 +0000)]
[CUDA] updated CompileCudaWithLLVM.rst

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-apply r346985: [ADT] Drop llvm::Optional clang-specific optimization for trivially...
Tom Stellard [Fri, 16 Nov 2018 00:47:24 +0000 (00:47 +0000)]
Re-apply r346985: [ADT] Drop llvm::Optional clang-specific optimization for trivially copyable types

Remove a test case that was added with the optimization we are now
removing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347004 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Split BBs after throw instructions
Heejin Ahn [Fri, 16 Nov 2018 00:47:18 +0000 (00:47 +0000)]
[WebAssembly] Split BBs after throw instructions

Summary:
`throw` instruction is a terminator in wasm, but BBs were not splitted
after `throw` instructions, causing machine instruction verifier to
fail.

This patch
- Splits BBs after `throw` instructions in WasmEHPrepare and adding an
  unreachable instruction after `throw`, which will be deleted in
  LateEHPrepare pass
- Refactors WasmEHPrepare into two member functions
- Changes the semantics of `eraseBBsAndChildren` in LateEHPrepare pass
  to match that of WasmEHPrepare pass, which is newly added. Now
  `eraseBBsAndChildren` does not delete BBs with remaining predecessors.
- Fixes style nits, making static function names conform to clang-tidy
- Re-enables the test temporarily disabled by rL346840 && rL346845

Reviewers: dschuff

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347003 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] NFC Test commit
Ron Lieberman [Fri, 16 Nov 2018 00:46:51 +0000 (00:46 +0000)]
[AMDGPU] NFC Test commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347002 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDHSA: More code object v3 fixes:
Konstantin Zhuravlyov [Thu, 15 Nov 2018 23:14:23 +0000 (23:14 +0000)]
AMDHSA: More code object v3 fixes:

  - Make sure IsaInfo::hasCodeObjectV3 returns true only
    for AMDHSA
  - Update assembler metadata tests to use v2 by default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347001 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove ANY_EXTEND special case from canReduceVMulWidth
Craig Topper [Thu, 15 Nov 2018 21:19:32 +0000 (21:19 +0000)]
[X86] Remove ANY_EXTEND special case from canReduceVMulWidth

Removing this code doesn't affect any lit tests so it doesn't appear to be tested anymore. I assume it was when it was added, but I guess something else changed? Code coverage report also says its unused.

I mostly didn't like that it seemed to count the sign bits as if it was a sign_extend, but then set isPositive as if it was a zero_extend. It feels like we should have picked one interpretation?

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Update code object metadata format documentation
Scott Linder [Thu, 15 Nov 2018 20:46:55 +0000 (20:46 +0000)]
[AMDGPU] Update code object metadata format documentation

* Add amdhsa prefix to names to allow other tools to use the metadata
  without collision.
* Make names consistent.
* Simplify structure.
* Change note record ID.
* Switch from YAML to MsgPack format.
* Document metadata assembler directive.

Patch By: t-tye (Tony Tye)
Differential Revision: https://reviews.llvm.org/D53445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346992 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable...
Tom Stellard [Thu, 15 Nov 2018 20:27:11 +0000 (20:27 +0000)]
Revert "[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types"

This reverts commit r346985.

It looks like one of the unittests also needs to be updated, reverting while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346990 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types
Tom Stellard [Thu, 15 Nov 2018 19:32:24 +0000 (19:32 +0000)]
[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types

Summary:
This fixes libLLVM.so ABI mismatches between llvm compiled with clang
and llvm compiled with gcc (PR39427).

Reviewers: bkramer, sylvestre.ledru, mgorny, hans

Reviewed By: bkramer, hans

Subscribers: dexonsmith, kristina, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346985 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Minor cleanup to getExtendInVec. NFCI
Craig Topper [Thu, 15 Nov 2018 19:20:22 +0000 (19:20 +0000)]
[X86] Minor cleanup to getExtendInVec. NFCI

Use unsigned to calculate the subvector index to avoid a cast.

Remove an unnecessary condition and replace it with a stronger assert.

Use the InVT variable we updated when we extracted instead of grabbing it from the In SDValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346983 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] adjust rotate direction in tests; NFC
Sanjay Patel [Thu, 15 Nov 2018 19:15:41 +0000 (19:15 +0000)]
[InstCombine] adjust rotate direction in tests; NFC

Copy/paste errors - all of the changed tests rotated left before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346982 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add -x86-experimental-vector-widening support to reduceVMULWidth and combineMul...
Craig Topper [Thu, 15 Nov 2018 18:59:31 +0000 (18:59 +0000)]
[X86] Add -x86-experimental-vector-widening support to reduceVMULWidth and combineMulToPMADDWD

In reduceVMULWidth, we no longer need to worry about extending the vector to 128 bits first. Regular widening of extends, muls and shuffles will take care of that for us.

In combineMulToPMADDWD, we can handle v2i32 multiplies and allow the VPMADDWD to be widened to v4i32 during type legalization by adding custom widening like we do have for AVG/ADDUS/SUBUS. I had to modify that code a little to allow different and output VTs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346980 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Fix return type of nextByte
Thomas Lively [Thu, 15 Nov 2018 18:56:49 +0000 (18:56 +0000)]
[WebAssembly] Fix return type of nextByte

Summary:
The old return type did not allow for correct error reporting and was
causing a compiler warning.

Reviewers: aheejin

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346979 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BinaryFormat] Add MsgPackTypes
Scott Linder [Thu, 15 Nov 2018 18:50:01 +0000 (18:50 +0000)]
[BinaryFormat] Add MsgPackTypes

Add data structure to represent MessagePack "documents" and convert
to/from both MessagePack and YAML encodings.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346978 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add tests for funnel shift (rotate) canonicalization; NFC
Sanjay Patel [Thu, 15 Nov 2018 18:19:56 +0000 (18:19 +0000)]
[InstCombine] add tests for funnel shift (rotate) canonicalization; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346975 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Guess that a CPU is Icelake it if reports support for AVX512VBMI2.
Craig Topper [Thu, 15 Nov 2018 18:11:52 +0000 (18:11 +0000)]
[X86] Guess that a CPU is Icelake it if reports support for AVX512VBMI2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346973 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LTO] Load sample profile in LTO link step.
Xin Tong [Thu, 15 Nov 2018 18:06:42 +0000 (18:06 +0000)]
[LTO] Load sample profile in LTO link step.

Summary:
Load sample profile in LTO link step.
ThinLTO calls populateModulePassManager to load the profile

Reviewers: tejohnson, davidxl, danielcdh

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346971 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI] Reduction costs only need to include a single extract element cost
Simon Pilgrim [Thu, 15 Nov 2018 17:42:53 +0000 (17:42 +0000)]
[TTI] Reduction costs only need to include a single extract element cost

We were adding the entire scalarization extraction cost for reductions, which returns the total cost of extracting every element of a vector type.

For reductions we don't need to do this - we just need to extract the 0'th element after the reduction pattern has completed.

Fixes PR37731

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346970 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] fix rotate narrowing bug for non-pow-2 types
Sanjay Patel [Thu, 15 Nov 2018 17:19:14 +0000 (17:19 +0000)]
[InstCombine] fix rotate narrowing bug for non-pow-2 types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346968 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add rotate narrowing tests with odd types; NFC
Sanjay Patel [Thu, 15 Nov 2018 16:34:26 +0000 (16:34 +0000)]
[InstCombine] add rotate narrowing tests with odd types; NFC

There's a potential miscompile here. It's unlikely in the real
world because this transform is guarded with shouldChangeType(),
but this test file doesn't include a standard data-layout for
some reason (despite including a custom 1), so we can see the bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLPVectorizer][X86] Regenerate reduction minmax tests and cleanup check prefixes
Simon Pilgrim [Thu, 15 Nov 2018 16:34:15 +0000 (16:34 +0000)]
[SLPVectorizer][X86] Regenerate reduction minmax tests and cleanup check prefixes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346965 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLPVectorizer][X86] Regenerate reduction tests and add PR37731 test
Simon Pilgrim [Thu, 15 Nov 2018 16:08:25 +0000 (16:08 +0000)]
[SLPVectorizer][X86] Regenerate reduction tests and add PR37731 test

Cleanup check prefixes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346964 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Fix MCNullStreamer support for modules with a CodeView flag
Simon Pilgrim [Thu, 15 Nov 2018 15:17:15 +0000 (15:17 +0000)]
[X86] Fix MCNullStreamer support for modules with a CodeView flag

This fixes -filetype=null support when compiling for a Win32 target and the module has a CodeView flag.

The only places changed are the uses of getTargetStreamer function - this patch guards both of them with null checks.

Committed on behalf of @eush (Eugene Sharygin)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346962 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify] delete shift-of-zero guard ops around funnel shifts
Sanjay Patel [Thu, 15 Nov 2018 14:53:37 +0000 (14:53 +0000)]
[InstSimplify] delete shift-of-zero guard ops around funnel shifts

This is a problem seen in common rotate idioms as noted in:
https://bugs.llvm.org/show_bug.cgi?id=34924

Note that we are not canonicalizing standard IR (shifts and logic) to the intrinsics yet.
(Although I've written this before...) I think this is the last step before we enable
that transform. Ie, we could regress code by doing that transform without this
simplification in place.

In PR34924, I questioned whether this is a valid transform for target-independent IR,
but I convinced myself this is ok. If we're speculating a funnel shift by turning cmp+br
into select, then SimplifyCFG has already determined that the transform is justified.
It's possible that SimplifyCFG is not taking into account profile or other metadata,
but if that's true, then it's a bug independent of funnel shifts.

Also, we do have CGP code to restore a guard like this around an intrinsic if it can't
be lowered cheaply. But that isn't necessary for funnel shift because the default
expansion in SelectionDAGBuilder includes this same cmp+select.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346960 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Mark C.EBREAK instruction as having side effects
Alex Bradbury [Thu, 15 Nov 2018 14:52:24 +0000 (14:52 +0000)]
[RISCV] Mark C.EBREAK instruction as having side effects

C.EBREAK was defined with hasSideEffects = 0, which is incorrect and
inconsistent with the non-compressed instruction form. This patch corrects
this oversight.

This wouldn't cause codegen issues, as compressed instructions are only ever
generated by converting the non-compressed form as an MCInst. But having
correct flags is still worthwhile.

Differential Revision: https://reviews.llvm.org/D54256
Patch by Luís Marques.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346959 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Mark FREM as Expand
Alex Bradbury [Thu, 15 Nov 2018 14:46:11 +0000 (14:46 +0000)]
[RISCV] Mark FREM as Expand

Mark the FREM SelectionDAG node as Expand, which is necessary in order to
support the frem IR instruction on RISC-V. This is expanded into a library
call. Adds the corresponding test. Previously, this would have triggered an
assertion at instruction selection time.

Differential Revision: https://reviews.llvm.org/D54159
Patch by Luís Marques.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346958 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd missed files from prev. commit
Anton Korobeynikov [Thu, 15 Nov 2018 12:35:04 +0000 (12:35 +0000)]
Add missed files from prev. commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MSP430] Add MC layer
Anton Korobeynikov [Thu, 15 Nov 2018 12:29:43 +0000 (12:29 +0000)]
[MSP430] Add MC layer

Reapply r346374 with the fixes for modules build.

Original summary:

This change implements assembler parser, code emitter, ELF object writer
and disassembler for the MSP430 ISA.  Also, more instruction forms are added
to the target description.

Patch by Michael Skvortsov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346948 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Use `auto` declaration in typecasting
Xing GUO [Thu, 15 Nov 2018 11:51:13 +0000 (11:51 +0000)]
[llvm-objdump] Use `auto` declaration in typecasting

Summary:
According to `MaskRay`, use `auto` for type inference, according to coding standards.
Delete some comments, because these comments can be easily inferred from codes.

Reviewers: jhenderson, MaskRay

Reviewed By: jhenderson

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346946 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Introduce the RISCVMatInt::generateInstSeq helper
Alex Bradbury [Thu, 15 Nov 2018 10:11:31 +0000 (10:11 +0000)]
[RISCV] Introduce the RISCVMatInt::generateInstSeq helper

Logic to load 32-bit and 64-bit immediates is currently present in
RISCVAsmParser::emitLoadImm in order to support the li pseudoinstruction. With
the introduction of RV64 codegen, there is a greater benefit of sharing
immediate materialisation logic between the MC layer and codegen. The
generateInstSeq helper allows this by producing a vector of simple structs
representing the chosen instructions. This can then be consumed in the MC
layer to produce MCInsts or at instruction selection time to produce
appropriate SelectionDAG node. Sharing this logic means that both the li
pseudoinstruction and codegen can benefit from future optimisations, and
that this logic can be used for materialising constants during RV64 codegen.

This patch does contain a behaviour change: addi will now be produced on RV64
when no lui is necessary to materialise the constant. In that case addiw takes
x0 as the source register, so is semantically identical to addi.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add some custom type legalization rules for truncate with -x86-experimental...
Craig Topper [Thu, 15 Nov 2018 08:23:40 +0000 (08:23 +0000)]
[X86] Add some custom type legalization rules for truncate with -x86-experimental-vector-widening-legalization.

This avoids some nasty shuffles when we have avx512. It will also prevent using zmm truncate instructions when a ymm instruction that zeroes part of an xmm register will do. Also avoid using avx512 truncate instructions when the input is 128 bits or less. These instructions are 2 uops on skx so we can probably find a better single uop shuffle like pshufb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add -x86-experimental-vector-widening-legalization versions of shuffle-vs-trunc...
Craig Topper [Thu, 15 Nov 2018 08:23:37 +0000 (08:23 +0000)]
[X86] Add -x86-experimental-vector-widening-legalization versions of shuffle-vs-trunc tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346935 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Renumber SIMD bitwise instructions
Thomas Lively [Thu, 15 Nov 2018 03:38:59 +0000 (03:38 +0000)]
[WebAssembly] Renumber SIMD bitwise instructions

Summary: Changed to match https://github.com/WebAssembly/simd/pull/54.

Reviewers: aheejin

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346931 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Fix check lines in fdot2 test:
Konstantin Zhuravlyov [Thu, 15 Nov 2018 02:42:04 +0000 (02:42 +0000)]
AMDGPU: Fix check lines in fdot2 test:

GCN900 -> GFX900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[commit-test] Add blank line for test/tools/llvm-objdump/symbol-table-elf.test
Xing GUO [Thu, 15 Nov 2018 02:36:20 +0000 (02:36 +0000)]
[commit-test] Add blank line for test/tools/llvm-objdump/symbol-table-elf.test

Summary: Test commit

Reviewers: Higuoxing

Reviewed By: Higuoxing

Subscribers: llvm-commits, Higuoxing

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Enable code object v3 for AMDHSA only
Konstantin Zhuravlyov [Thu, 15 Nov 2018 02:32:43 +0000 (02:32 +0000)]
AMDGPU: Enable code object v3 for AMDHSA only

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346923 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Don't mark SEXTLOADS with narrow types as Custom with -x86-experimental-vector...
Craig Topper [Thu, 15 Nov 2018 00:21:41 +0000 (00:21 +0000)]
[X86] Don't mark SEXTLOADS with narrow types as Custom with -x86-experimental-vector-widening-legalization.

The narrow types end up requesting widening, but generic legalization will end up scalaring and using a build_vector to do the widening.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346916 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachineOutliner][NFC] Check if CandidatesForRepeatedSeq < 2
Jessica Paquette [Thu, 15 Nov 2018 00:02:24 +0000 (00:02 +0000)]
[MachineOutliner][NFC] Check if CandidatesForRepeatedSeq < 2

There's no reason to call getOutliningCandidateInfo with a single candidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346913 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove unused variable
Benjamin Kramer [Wed, 14 Nov 2018 23:13:27 +0000 (23:13 +0000)]
[X86] Remove unused variable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346909 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Support v2i32/v4i16/v8i8 load/store using f64 on 32-bit targets under -x86...
Craig Topper [Wed, 14 Nov 2018 23:02:09 +0000 (23:02 +0000)]
[X86] Support v2i32/v4i16/v8i8 load/store using f64 on 32-bit targets under -x86-experimental-vector-widening-legalization.

On 64-bit targets the type legalizer will use i64 to legalize these. But when i64 isn't legal, the type legalizer won't try an FP type. So do it manually instead.

There are a few regressions in here due to some v2i32 operations like mul and div now being reassembled into a full vector just to store instead of storing the pieces. But this was already occuring in 64-bit mode so its not a new issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346908 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Update masked expandload/compressstore test names
Simon Pilgrim [Wed, 14 Nov 2018 22:44:08 +0000 (22:44 +0000)]
[X86] Update masked expandload/compressstore test names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346903 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify] add more tests for funnel shift with select; NFC
Sanjay Patel [Wed, 14 Nov 2018 22:34:25 +0000 (22:34 +0000)]
[InstSimplify] add more tests for funnel shift with select; NFC

The cases are just different enough that we should have
complete tests to avoid bugs from typos in the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346902 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachineOutliner][NFC] Don't compute liveness if X16/X17/NZCV are unused
Jessica Paquette [Wed, 14 Nov 2018 22:23:38 +0000 (22:23 +0000)]
[MachineOutliner][NFC] Don't compute liveness if X16/X17/NZCV are unused

Using the MBB flags, we can tell if X16/X17/NZCV are unused in a block,
and also not live out.

If this holds for all MBBs, then we can avoid checking for liveness on
that candidate. Furthermore, if it holds for an individual candidate's
MBB, then we can avoid checking for liveness on that candidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346901 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove unused getMDNodeFwdRefOrNull interfaces (NFC)
Teresa Johnson [Wed, 14 Nov 2018 21:57:51 +0000 (21:57 +0000)]
Remove unused getMDNodeFwdRefOrNull interfaces (NFC)

Summary:
Followup from D53596/r346891. Remove the getMDNodeFwdRefOrNull interface
to the MDLoader since it is no longer used. Also improve error messages
when the internal implementation is used within the MDLoader.

Reviewers: steven_wu

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346899 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Add SSE2/SSE42 masked load/store tests
Simon Pilgrim [Wed, 14 Nov 2018 21:31:50 +0000 (21:31 +0000)]
[X86][SSE] Add SSE2/SSE42 masked load/store tests

Now that the load/store tests are split the impact of running the tests on multiple (illegal) targets is a lot less impactful

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346896 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoBias physical register immediate assignments
Nirav Dave [Wed, 14 Nov 2018 21:11:53 +0000 (21:11 +0000)]
Bias physical register immediate assignments

The machine scheduler currently biases register copies to/from
physical registers to be closer to their point of use / def to
minimize their live ranges. This change extends this to also physical
register assignments from immediate values.

This causes a reduction in reduction in overall register pressure and
minor reduction in spills and indirectly fixes an out-of-registers
assertion (PR39391).

Most test changes are from minor instruction reorderings and register
name selection changes and direct consequences of that.

Reviewers: MatzeB, qcolombet, myatsina, pcc

Subscribers: nemanjai, jvesely, nhaehnle, eraman, hiraditya,
  javed.absar, arphaman, jfb, jsji, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346894 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Fix a crash in lazy loading of Metadata
Teresa Johnson [Wed, 14 Nov 2018 20:58:04 +0000 (20:58 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata

This is a revised version of D41474.

When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.

Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.

To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.

Fixes PR35472.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346891 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Split masked load/store test files
Simon Pilgrim [Wed, 14 Nov 2018 20:44:59 +0000 (20:44 +0000)]
[X86] Split masked load/store test files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Update masked load/store test names
Simon Pilgrim [Wed, 14 Nov 2018 20:25:50 +0000 (20:25 +0000)]
[X86] Update masked load/store test names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346887 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Additional pattern for i16 median3 matching
Aakanksha Patil [Wed, 14 Nov 2018 20:10:41 +0000 (20:10 +0000)]
AMDGPU: Additional pattern for i16 median3 matching

min(max(a, b), max(min(a, b), c))

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346886 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMark @llvm.trap cold
Vedant Kumar [Wed, 14 Nov 2018 19:53:41 +0000 (19:53 +0000)]
Mark @llvm.trap cold

A call to @llvm.trap can be expected to be cold (i.e. unlikely to be
reached in a normal program execution).

Outlining paths which unconditionally trap is an important memory
saving. As the hot/cold splitting pass (imho) should not treat all
noreturn calls as cold, explicitly mark @llvm.trap cold so that it can
be outlined.

Split out of https://reviews.llvm.org/D54244.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346885 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Teach YAMLIO about polymorphic types
Scott Linder [Wed, 14 Nov 2018 19:39:59 +0000 (19:39 +0000)]
[Support] Teach YAMLIO about polymorphic types

Add support for "polymorphic" types to YAMLIO.

PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or
Sequence). When inputting, the PolymorphicTraits type is told which type to
become, and when outputting the PolymorphicTraits type is asked which type it
currently is.

Also add support for TaggedScalarTraits to allow dynamically differentiating
between multiple scalar types using YAML tags.

Serialize empty maps as "{}" and empty sequences as "[]", so that types
are preserved when round-tripping PolymorphicTraits. This change has
equivalent semantics, but may break e.g. tests which compare output
verbatim.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346884 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Update handling of vararg functions to match inliner
Teresa Johnson [Wed, 14 Nov 2018 19:30:13 +0000 (19:30 +0000)]
[ThinLTO] Update handling of vararg functions to match inliner

Summary:
Previously we marked all vararg functions as non-inlinable in the
function summary, which prevented their importing. However, the
corresponding inliner restriction was loosened in r321940/r342675
to only apply to functions calling va_start. Adjust the summary
flag computation to match.

Reviewers: davidxl

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346883 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify] add tests for funnel shift with select; NFC
Sanjay Patel [Wed, 14 Nov 2018 19:12:54 +0000 (19:12 +0000)]
[InstSimplify] add tests for funnel shift with select; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346881 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Add support for dylink section in object format
Sam Clegg [Wed, 14 Nov 2018 18:36:24 +0000 (18:36 +0000)]
[WebAssembly] Add support for dylink section in object format

See https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346880 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Allow pmulh to be formed from narrow vXi16 vectors under -x86-experimental...
Craig Topper [Wed, 14 Nov 2018 18:16:21 +0000 (18:16 +0000)]
[X86] Allow pmulh to be formed from narrow vXi16 vectors under -x86-experimental-vector-widening-legalization

Narrower vectors will be widened to 128 bits without changing the element size. And generic type legalization can already handle widening mulhu/mulhs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346879 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Remove a couple of asserts based on incorrect assumptions
Mandeep Singh Grang [Wed, 14 Nov 2018 17:55:07 +0000 (17:55 +0000)]
[InstCombine] Remove a couple of asserts based on incorrect assumptions

Summary:
These asserts are based on the assumption that the order of true/false operands in a select and those in the compare would always be the same.
This fixes PR39595.

Reviewers: craig.topper, spatel, dmgreen

Reviewed By: craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346874 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] fix formatting for matchBSwap(); NFC
Sanjay Patel [Wed, 14 Nov 2018 16:03:36 +0000 (16:03 +0000)]
[InstCombine] fix formatting for matchBSwap(); NFC

We should have a similar function for matching rotate and/or
funnel shift, so tidy up the related existing call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346871 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VPlan, SLP] Use SmallPtrSet for Candidates.
Florian Hahn [Wed, 14 Nov 2018 15:58:40 +0000 (15:58 +0000)]
[VPlan, SLP] Use SmallPtrSet for Candidates.

This slightly improves the candidate handling in getBest().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG] Regenerate preserve-branchweights.ll test. NFC
John Brawn [Wed, 14 Nov 2018 15:27:07 +0000 (15:27 +0000)]
[SimplifyCFG] Regenerate preserve-branchweights.ll test. NFC

Regenerate this test using update_test_checks.py in preparation for an
upcomming commit, to make it not depend on the names of instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346869 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue
Simon Pilgrim [Wed, 14 Nov 2018 15:04:08 +0000 (15:04 +0000)]
[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346868 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDocument how to comment an actual parameter.
Paul Robinson [Wed, 14 Nov 2018 13:43:19 +0000 (13:43 +0000)]
Document how to comment an actual parameter.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346861 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VPlan] Remove LLVM_DEBUG from VPlanSlp::dumpBundle.
Florian Hahn [Wed, 14 Nov 2018 13:33:44 +0000 (13:33 +0000)]
[VPlan] Remove LLVM_DEBUG from VPlanSlp::dumpBundle.

The caller should take care of only calling it with debug enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346860 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI] Pull out repeated 'ConcreteTTI' static_casts. NFCI.
Simon Pilgrim [Wed, 14 Nov 2018 13:23:28 +0000 (13:23 +0000)]
[TTI] Pull out repeated 'ConcreteTTI' static_casts. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346859 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VPlan] Update ifdef.
Florian Hahn [Wed, 14 Nov 2018 13:21:26 +0000 (13:21 +0000)]
[VPlan] Update ifdef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346858 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[VPlan, SLP] Add simple SLP analysis on top of VPlan.
Florian Hahn [Wed, 14 Nov 2018 13:11:49 +0000 (13:11 +0000)]
[VPlan, SLP] Add simple SLP analysis on top of VPlan.

This patch adds an initial implementation of the look-ahead SLP tree
construction described in 'Look-Ahead SLP: Auto-vectorization in the Presence
of Commutative Operations, CGO 2018 by Vasileios Porpodas, Rodrigo C. O. Rocha,
Luís F. W. Góes'.

It returns an SLP tree represented as VPInstructions, with combined
instructions represented as a single, wider VPInstruction.

This initial version does not support instructions with multiple
different users (either inside or outside the SLP tree) or
non-instruction operands; it won't generate any shuffles or
insertelement instructions.

It also just adds the analysis that builds an SLP tree rooted in a set
of stores. It does not include any cost modeling or memory legality
checks. The plan is to integrate it with VPlan based cost modeling, once
available and to only apply it to operations that can be widened.

A follow-up patch will add a support for replacing instructions in a
VPlan with their SLP counter parts.

Reviewers: Ayal, mssimpso, rengolin, mkuper, hfinkel, hsaito, dcaballe, vporpo, RKSimon, ABataev

Reviewed By: rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346857 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CostModel] Add generic expansion funnel shift cost support
Simon Pilgrim [Wed, 14 Nov 2018 12:24:50 +0000 (12:24 +0000)]
[CostModel] Add generic expansion funnel shift cost support

Add support for the expansion of funnelshift/rotates to getIntrinsicInstrCost.

This also required us to move the X86 fshl/fshr costs to the same place as the rotates to avoid expansion and get correct scalarization vs vectorization costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346854 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Improve ELF file type checking statements (D54509)
Xing GUO [Wed, 14 Nov 2018 11:30:34 +0000 (11:30 +0000)]
[llvm-objdump] Improve ELF file type checking statements (D54509)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346851 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX512] Remove constant pool shuffle decoding from SelectionDAG
Simon Pilgrim [Wed, 14 Nov 2018 11:26:35 +0000 (11:26 +0000)]
[X86][AVX512] Remove constant pool shuffle decoding from SelectionDAG

This patch removes the last use of the constant pool shuffle decode helper and consistently uses the 'getTargetShuffleMaskIndices' versions instead. The constant pool versions are now purely used for assembly comments.

The avx512vbmi intrinsic upgrades had to be altered as they were being decoded as broadcasts, similar to what I fixed in rL346032. I don't think the change is critical - although its annoying that we lose the {k}{z} instruction test coverage as they are tricky to generate....

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346850 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Make sure event-section XFAILs for build options
Heejin Ahn [Wed, 14 Nov 2018 10:11:22 +0000 (10:11 +0000)]
[WebAssembly] Make sure event-section XFAILs for build options

rL346840 temporarily marked event-section.ll as XFAIL because it was
failing for builds with LLVM_ENABLE_EXPENSIVE_CHECKS turned on, but
to make sure it XFAILs even without LLVM_ENABLE_EXPENSIVE_CHECKS on we
need this `-verify-machineinstrs` flag, which was missing in the
previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346845 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoPrint newline after banner for ModulePass
Sven van Haastregt [Wed, 14 Nov 2018 10:05:28 +0000 (10:05 +0000)]
Print newline after banner for ModulePass

Before this commit, `llc -print-after-all` would print something like:

  *** IR Dump After Pre-ISel Intrinsic Lowering ***; ModuleID = ...

Emit a newline such that ModuleID appears on a line by its own.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346844 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call...
Florian Hahn [Wed, 14 Nov 2018 10:04:30 +0000 (10:04 +0000)]
Recommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call site).

The underlying problem causing the expensive-check failure was fixed in
rL346769.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346843 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Temporarily disable event-section.ll
Heejin Ahn [Wed, 14 Nov 2018 09:51:21 +0000 (09:51 +0000)]
[WebAssembly] Temporarily disable event-section.ll

This test is failing in builds with LLVM_ENABLE_EXPENSIVE_CHECKS after
rL346825 not because of the patch but due to a pre-existing codegen
problem. Marking this as XFAIL temporarily until the bug is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346840 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add -x86-experimental-vector-widening command lines to pmulh.ll
Craig Topper [Wed, 14 Nov 2018 07:51:26 +0000 (07:51 +0000)]
[X86] Add -x86-experimental-vector-widening command lines to pmulh.ll

I've only added sse2 and sse4.1 variants as I'm only interested in the two v4i16 tests and I don't expect that to different with AVX other than a v prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346834 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCorrectly instantiate `iterator_adaptor_base` when defining `pointer_iterator`
David Blaikie [Wed, 14 Nov 2018 07:19:21 +0000 (07:19 +0000)]
Correctly instantiate `iterator_adaptor_base` when defining `pointer_iterator`

The definition of `pointer_iterator` omits what should be a `iterator_traits::<>::iterator_category` parameter from `iterator_adaptor_base`. As a result, iterators based on `pointer_iterator` always have defaulted value types and the wrong iterator category.

The definition of `pointee_iterator` just a few lines above does this correctly.

This resolves [[ https://bugs.llvm.org/show_bug.cgi?id=39617 | bug 39617 ]].

Patch by Dylan MacKenzie!

Reviewers: dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346833 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Add support for the event section
Heejin Ahn [Wed, 14 Nov 2018 02:46:21 +0000 (02:46 +0000)]
[WebAssembly] Add support for the event section

Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)

The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.

This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support

Reviewers: dschuff, sbc100, aardappel

Subscribers: jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346825 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Enhance the selection(ISD::VSELECT) of vector type
Zi Xuan Wu [Wed, 14 Nov 2018 02:34:45 +0000 (02:34 +0000)]
[PowerPC] Enhance the selection(ISD::VSELECT) of vector type

To make ISD::VSELECT available(legal) so long as there are altivec instruction, otherwise it's default behavior is expanding,
which is legalized at type-legalization phase. Use xxsel to match vselect if vsx is open, or use vsel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346824 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r346810 "Preserve loop metadata when splitting exit blocks"
Reid Kleckner [Wed, 14 Nov 2018 01:47:32 +0000 (01:47 +0000)]
Revert r346810 "Preserve loop metadata when splitting exit blocks"

It broke the Windows self-host:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/1457

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346823 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Fix forward scan in MachineBasicBlock::computeRegisterLiveness.
Eli Friedman [Wed, 14 Nov 2018 00:39:29 +0000 (00:39 +0000)]
[CodeGen] Fix forward scan in MachineBasicBlock::computeRegisterLiveness.

The scan was incorrectly skipping the first instruction, so a register
could appear to be dead when it was actually live. This eventually leads
to a machine verifier failure and miscompile in arm-ldst-opt.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346821 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachineOutliner][NFC] Use flags set in all candidates to check for calls
Jessica Paquette [Tue, 13 Nov 2018 23:41:31 +0000 (23:41 +0000)]
[MachineOutliner][NFC] Use flags set in all candidates to check for calls

If we keep track of if the ContainsCalls bit is set in the MBB flags for each
candidate, then we have a better chance of not checking the candidate for calls
at all.

This saves quite a few checks in some CTMark tests (~200 in Bullet, for
example.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346816 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake dsymutil more robust when parsing load commands.
Adrian Prantl [Tue, 13 Nov 2018 23:31:25 +0000 (23:31 +0000)]
Make dsymutil more robust when parsing load commands.

rdar://problem/45883463

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346815 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] fold funnel shift amount based on demanded bits
Sanjay Patel [Tue, 13 Nov 2018 23:27:23 +0000 (23:27 +0000)]
[InstCombine] fold funnel shift amount based on demanded bits

The shift amount of a funnel shift is modulo the scalar bitwidth:
http://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic
...so we can use demanded bits analysis on that operand to simplify it
when we have a power-of-2 bitwidth.

This is another step towards canonicalizing {shift/shift/or} to the
intrinsics in IR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346814 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake the ExpandTilde unit test expect "\" (not "/") on Win32
Matthew Voss [Tue, 13 Nov 2018 23:21:00 +0000 (23:21 +0000)]
Make the ExpandTilde unit test expect "\" (not "/") on Win32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346813 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoPreserve loop metadata when splitting exit blocks
Craig Topper [Tue, 13 Nov 2018 23:06:49 +0000 (23:06 +0000)]
Preserve loop metadata when splitting exit blocks

LoopUtils.cpp contains a utility that splits an loop exit block, so that the new block contains only edges coming from the loop. In the case of nested loops, the exit path for the inner loop might also be the back-edge of the outer loop. The new block which is inserted on this path, is now a latch for the outer loop, and it needs to hold the loop metadata for the outer loop. (The test case gives a more concrete view of the situation.)

Patch by Chang Lin (clin1)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346810 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachineOutliner][NFC] Use MBB flags to avoid call checks in getOutliningInfo
Jessica Paquette [Tue, 13 Nov 2018 23:01:34 +0000 (23:01 +0000)]
[MachineOutliner][NFC] Use MBB flags to avoid call checks in getOutliningInfo

We already determine a bunch of information about an MBB in
getMachineOutlinerMBBFlags. We can reuse that information to avoid calculating
things that must be false/true.

The first thing we can easily check is if an outlined sequence could ever
contain calls. There's no reason to walk over the outlined range, checking for
calls, if we already know that there are no calls in the block containing the
sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346809 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] canonicalize rotate patterns with cmp/select
Sanjay Patel [Tue, 13 Nov 2018 22:47:24 +0000 (22:47 +0000)]
[InstCombine] canonicalize rotate patterns with cmp/select

The cmp+branch variant of this pattern is shown in:
https://bugs.llvm.org/show_bug.cgi?id=34924
...and as discussed there, we probably can't transform
that without a rotate intrinsic. We do have that now
via funnel shift, but we're not quite ready to
canonicalize IR to that form yet. The case with 'select'
should already be transformed though, so that's this patch.

The sequence with negation followed by masking is what we
use in the backend and partly in clang (though that part
should be updated).

https://rise4fun.com/Alive/TplC
  %cmp = icmp eq i32 %shamt, 0
  %sub = sub i32 32, %shamt
  %shr = lshr i32 %x, %shamt
  %shl = shl i32 %x, %sub
  %or = or i32 %shr, %shl
  %r = select i1 %cmp, i32 %x, i32 %or
  =>
  %neg = sub i32 0, %shamt
  %masked = and i32 %shamt, 31
  %maskedneg = and i32 %neg, 31
  %shl2 = lshr i32 %x, %masked
  %shr2 = shl i32 %x, %maskedneg
  %r = or i32 %shl2, %shr2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346807 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachineOutliner][NFC] Exit getOutliningType if there are < 2 candidates
Jessica Paquette [Tue, 13 Nov 2018 22:16:27 +0000 (22:16 +0000)]
[MachineOutliner][NFC] Exit getOutliningType if there are < 2 candidates

Since we never outline anything with fewer than 2 occurrences, there's no
reason to compute cost model information if there's less than that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346803 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] combine extractelement into several selects
Stanislav Mekhanoshin [Tue, 13 Nov 2018 21:18:21 +0000 (21:18 +0000)]
[AMDGPU] combine extractelement into several selects

An extractelement with non-constant index will be lowered either to
scratch or movrel loop in most cases. This patch converts such
instruction into a set of selects if vector size is not too big.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346800 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Create query after checking if instruction is a fence.
Alina Sbirlea [Tue, 13 Nov 2018 21:12:49 +0000 (21:12 +0000)]
[MemorySSA] Create query after checking if instruction is a fence.

The alternative is checking if I is a fence in the Query constructor, so
as to not attempt to get a non-existent MemoryLocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346798 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AsmPrinter] Fix DebugInfo/X86/gnu-public-names.ll after rL346790
Fangrui Song [Tue, 13 Nov 2018 20:59:25 +0000 (20:59 +0000)]
[AsmPrinter] Fix DebugInfo/X86/gnu-public-names.ll after rL346790

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346797 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFixed DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT i1 handling
Stanislav Mekhanoshin [Tue, 13 Nov 2018 20:26:27 +0000 (20:26 +0000)]
Fixed DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT i1 handling

Legalizer used to request an ext load from i8 to i1 when promoting
vector element type to i8. Fixed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346795 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a varia...
Nico Weber [Tue, 13 Nov 2018 20:18:26 +0000 (20:18 +0000)]
[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a variable's StorageClass.

undname prints them, and the information is in the decorated name, so we probably shouldn't lose it when undecorating.

I spot-checked a few of the funnier-looking outputs, and undname has the same output.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346791 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AsmPrinter] Rename a comment of .debug_gnu_pubnames entry
Fangrui Song [Tue, 13 Nov 2018 20:18:08 +0000 (20:18 +0000)]
[AsmPrinter] Rename a comment of .debug_gnu_pubnames entry

Summary:
The comment refers to the field as "Kind:". However, in gdb,

https://sourceware.org/gdb//onlinedocs/gdb/Index-Section-Format.html names it "attributes",
gdb/dwarf2read.c:dw2_symtab_iter_next refers to the whole value as "cu_index_and_attrs"

Change it to `Attributes:` for consistency.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: aprantl, JDevlieghere, arphaman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346790 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDebugInfo: Add a CU metadata attribute for use of DWARF ranges base address specifiers
David Blaikie [Tue, 13 Nov 2018 20:08:10 +0000 (20:08 +0000)]
DebugInfo: Add a CU metadata attribute for use of DWARF ranges base address specifiers

Summary:
Ranges base address specifiers can save a lot of object size in
relocation records especially in optimized builds.

For an optimized self-host build of Clang with split DWARF and debug
info compression in object files, but uncompressed debug info in the
executable, this change produces about 18% smaller object files and 6%
larger executable.

While it would've been nice to turn this on by default, gold's 32 bit
gdb-index support crashes on this input & I don't think there's any
perfect heuristic to implement solely in LLVM that would suffice - so
we'll need a flag one way or another (also possible people might want to
aggressively optimized for executable size that contains debug info
(even with compression this would still come at some cost to executable
size)) - so let's plumb it through.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346788 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NativePDB] Improved support for nested type reconstruction.
Zachary Turner [Tue, 13 Nov 2018 20:07:32 +0000 (20:07 +0000)]
[NativePDB] Improved support for nested type reconstruction.

In a previous patch, we pre-processed the TPI stream in order to build
the reverse mapping from nested type -> parent type so that we could
accurately reconstruct a DeclContext hierarchy.

However, there were some issues. An LF_NESTTYPE record is really just a
typedef, so although it happens to be used to indicate the name of the
nested type and referring to the global record which defines the type,
it is also used for every other kind of nested typedef. When we rebuild
the DeclContext hierarchy, we want it to be as accurate as possible,
which means that if we have something like:

  struct A {
    struct B {};
    using C = B;
  };

We don't want to create two CXXRecordDecls in the AST each with the
exact same definition. We just want to create one for B and then
define C as an alias to B. Previously, however, it would not be able
to distinguish between the two cases and it would treat A::B and
A::C as being two classes each with separate definitions. We address
the first half of improving the pre-processing logic so that only
actual definitions are treated this way.

Later, in a followup patch, we can handle the case of nested
typedefs since we're already going to be enumerating the field list
anyway and this patch introduces the general framework for
distinguishing between the two cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346786 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd fneg instruction to syntax highlighting lists
Matt Arsenault [Tue, 13 Nov 2018 19:50:38 +0000 (19:50 +0000)]
Add fneg instruction to syntax highlighting lists

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346785 91177308-0d34-0410-b5e6-96231b3b80d8