]> granicus.if.org Git - llvm/log
llvm
5 years agofix fmls fp16
Sebastian Pop [Tue, 8 Oct 2019 13:23:57 +0000 (13:23 +0000)]
fix fmls fp16

Tim Northover remarked that the added patterns for fmls fp16
produce wrong code in case the fsub instruction has a
multiplication as its first operand, i.e., all the patterns FMLSv*_OP1:

> define <8 x half> @test_FMLSv8f16_OP1(<8 x half> %a, <8 x half> %b, <8 x half> %c) {
> ; CHECK-LABEL: test_FMLSv8f16_OP1:
> ; CHECK: fmls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
> entry:
>
>   %mul = fmul fast <8 x half> %c, %b
>   %sub = fsub fast <8 x half> %mul, %a
>   ret <8 x half> %sub
> }
>
> This doesn't look right to me. The exact instruction produced is "fmls
> v0.8h, v2.8h, v1.8h", which I think calculates "v0 - v2*v1", but the
> IR is calculating "v2*v1-v0". The equivalent <4 x float> code also
> doesn't emit an fmls.

This patch generates an fmla and negates the value of the operand2 of the fsub.

Inspecting the pattern match, I found that there was another mistake in the
opcode to be selected: matching FMULv4*16 should generate FMLSv4*16
and not FMLSv2*32.

Tested on aarch64-linux with make check-all.

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

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

5 years agoAdd test for rotating truncated vectors. NFC
Amaury Sechet [Tue, 8 Oct 2019 13:08:51 +0000 (13:08 +0000)]
Add test for rotating truncated vectors. NFC

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

5 years ago[SVE][IR] Scalable Vector size queries and IR instruction support
Graham Hunter [Tue, 8 Oct 2019 12:53:54 +0000 (12:53 +0000)]
[SVE][IR] Scalable Vector size queries and IR instruction support

* Adds a TypeSize struct to represent the known minimum size of a type
  along with a flag to indicate that the runtime size is a integer multiple
  of that size
* Converts existing size query functions from Type.h and DataLayout.h to
  return a TypeSize result
* Adds convenience methods (including a transparent conversion operator
  to uint64_t) so that most existing code 'just works' as if the return
  values were still scalars.
* Uses the new size queries along with ElementCount to ensure that all
  supported instructions used with scalable vectors can be constructed
  in IR.

Reviewers: hfinkel, lattner, rkruppe, greened, rovka, rengolin, sdesmalen

Reviewed By: rovka, sdesmalen

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

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

5 years agoAMDGPU: Propagate undef flag during pre-RA exec mask optimizations
Nicolai Haehnle [Tue, 8 Oct 2019 12:46:32 +0000 (12:46 +0000)]
AMDGPU: Propagate undef flag during pre-RA exec mask optimizations

Summary: Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoMachineSSAUpdater: insert IMPLICIT_DEF at top of basic block
Nicolai Haehnle [Tue, 8 Oct 2019 12:46:20 +0000 (12:46 +0000)]
MachineSSAUpdater: insert IMPLICIT_DEF at top of basic block

Summary:
When getValueInMiddleOfBlock happens to be called for a basic block
that has no incoming value at all, an IMPLICIT_DEF is inserted in that
block via GetValueAtEndOfBlockInternal. This IMPLICIT_DEF must be at
the top of its basic block or it will likely not reach the use that
the caller intends to insert.

Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

Reviewers: arsenm, rampitec

Subscribers: jvesely, wdng, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[SLP] add test with prefer-vector-width function attribute; NFC
Sanjay Patel [Tue, 8 Oct 2019 12:43:46 +0000 (12:43 +0000)]
[SLP] add test with prefer-vector-width function attribute; NFC

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

5 years ago[LoopRotate] Unconditionally get DomTree.
Florian Hahn [Tue, 8 Oct 2019 11:54:42 +0000 (11:54 +0000)]
[LoopRotate] Unconditionally get DomTree.

LoopRotate is a loop pass and the DomTree should always be available.

Similar to a70c5261436322a53187d67b8bdc0445d0463a9a

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

5 years ago[MCA][LSUnit] Track loads and stores until retirement.
Andrea Di Biagio [Tue, 8 Oct 2019 10:46:01 +0000 (10:46 +0000)]
[MCA][LSUnit] Track loads and stores until retirement.

Before this patch, loads and stores were only tracked by their corresponding
queues in the LSUnit from dispatch until execute stage. In practice we should be
more conservative and assume that memory opcodes leave their queues at
retirement stage.

Basically, loads should leave the load queue only when they have completed and
delivered their data. We conservatively assume that a load is completed when it
is retired. Stores should be tracked by the store queue from dispatch until
retirement. In practice, stores can only leave the store queue if their data can
be written to the data cache.

This is mostly a mechanical change. With this patch, the retire stage notifies
the LSUnit when a memory instruction is retired. That would triggers the release
of LDQ/STQ entries.  The only visible change is in memory tests for the bdver2
model. That is because bdver2 is the only model that defines the load/store
queue size.

This patch partially addresses PR39830.

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

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

5 years ago[ISEL][ARM][AARCH64] Tracking simple parameter forwarding registers
Nikola Prica [Tue, 8 Oct 2019 09:43:05 +0000 (09:43 +0000)]
[ISEL][ARM][AARCH64] Tracking simple parameter forwarding registers

Support for tracking registers that forward function parameters into the
following function frame. For now we only support cases when parameter
is forwarded through single register.

Reviewers: aprantl, vsk, t.p.northover

Reviewed By: vsk

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

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

5 years ago[llvm-exegesis] Finish plumbing the `Config` field.
Clement Courbet [Tue, 8 Oct 2019 09:06:48 +0000 (09:06 +0000)]
[llvm-exegesis] Finish plumbing the `Config` field.

Summary:
Right now there are no snippet generators that emit the `Config` Field,
but I plan to add it to investigate LEA operands for PR32326.

What was broken was:
 - `Config` Was not propagated up until the BenchmarkResult::Key.
 - Clustering should really consider different configs as measuring
 different things, so we should stabilize on (Opcode, Config) instead of
 just Opcode.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits, lebedev.ri

Tags: #llvm

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

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

5 years ago[llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.
George Rimar [Tue, 8 Oct 2019 08:59:12 +0000 (08:59 +0000)]
[llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.

We do not check the GNU-style output when -all is given.
This patch does that.

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

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

5 years ago[NFC] Add REQUIRES for r374017 in testcase
Zi Xuan Wu [Tue, 8 Oct 2019 08:49:15 +0000 (08:49 +0000)]
[NFC] Add REQUIRES for r374017 in testcase

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

5 years ago[LoopRotate] Unconditionally get ScalarEvolution.
Florian Hahn [Tue, 8 Oct 2019 08:46:38 +0000 (08:46 +0000)]
[LoopRotate] Unconditionally get ScalarEvolution.

Summary: LoopRotate is a loop pass and SE should always be available.

Reviewers: anemet, asbirlea

Reviewed By: asbirlea

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

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

5 years ago[ARM] Generate vcmp instead of vcmpe
Kristof Beyls [Tue, 8 Oct 2019 08:25:42 +0000 (08:25 +0000)]
[ARM] Generate vcmp instead of vcmpe

Based on the discussion in
http://lists.llvm.org/pipermail/llvm-dev/2019-October/135574.html, the
conclusion was reached that the ARM backend should produce vcmp instead
of vcmpe instructions by default, i.e. not be producing an Invalid
Operation exception when either arguments in a floating point compare
are quiet NaNs.

In the future, after constrained floating point intrinsics for floating
point compare have been introduced, vcmpe instructions probably should
be produced for those intrinsics - depending on the exact semantics
they'll be defined to have.

This patch logically consists of the following parts:
- Revert http://llvm.org/viewvc/llvm-project?rev=294945&view=rev and
  http://llvm.org/viewvc/llvm-project?rev=294968&view=rev, which
  implemented fine-tuning for when to produce vcmpe (i.e. not do it for
  equality comparisons). The complexity introduced by those patches
  isn't needed anymore if we just always produce vcmp instead. Maybe
  these patches need to be reintroduced again once support is needed to
  map potential LLVM-IR constrained floating point compare intrinsics to
  the ARM instruction set.
- Simply select vcmp, instead of vcmpe, see simple changes in
  lib/Target/ARM/ARMInstrVFP.td
- Adapt lots of tests that tested for vcmpe (instead of vcmp). For all
  of these test, the intent of what is tested for isn't related to
  whether the vcmp should produce an Invalid Operation exception or not.

Fixes PR43374.

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

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

5 years ago[Tools] Mark output of tools as text if it is text
Kai Nacke [Tue, 8 Oct 2019 08:21:20 +0000 (08:21 +0000)]
[Tools] Mark output of tools as text if it is text

Several LLVM tools write text files/streams without using OF_Text.
This can cause problems on platforms which distinguish between
text and binary output. This PR adds the OF_Text flag for the
following tools:

- llvm-dis
- llvm-dwarfdump
- llvm-mca
- llvm-mc (assembler files only)
- opt (assembler files only)
- RemarkStreamer (used e.g. by opt)

Reviewers: rnk, vivekvpandya, Bigcheese, andreadb

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

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

5 years ago[LoopVectorize] Fix non-debug builds after rL374017
Kadir Cetinkaya [Tue, 8 Oct 2019 07:39:50 +0000 (07:39 +0000)]
[LoopVectorize] Fix non-debug builds after rL374017

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

5 years ago[llvm-exegesis] Add stabilization test with config
Clement Courbet [Tue, 8 Oct 2019 07:08:48 +0000 (07:08 +0000)]
[llvm-exegesis] Add stabilization test with config

In preparation for D68629.

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

5 years ago[IA] Recognize hexadecimal escape sequences
Bill Wendling [Tue, 8 Oct 2019 04:39:52 +0000 (04:39 +0000)]
[IA] Recognize hexadecimal escape sequences

Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.

Reviewers: nickdesaulniers, jcai19

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

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

5 years ago[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop...
Zi Xuan Wu [Tue, 8 Oct 2019 03:28:33 +0000 (03:28 +0000)]
[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize

In loop-vectorize, interleave count and vector factor depend on target register number. Currently, it does not
estimate different register pressure for different register class separately(especially for scalar type,
float type should not be on the same position with int type), so it's not accurate. Specifically,
it causes too many times interleaving/unrolling, result in too many register spills in loop body and hurting performance.

So we need classify the register classes in IR level, and importantly these are abstract register classes,
and are not the target register class of backend provided in td file. It's used to establish the mapping between
the types of IR values and the number of simultaneous live ranges to which we'd like to limit for some set of those types.

For example, POWER target, register num is special when VSX is enabled. When VSX is enabled, the number of int scalar register is 32(GPR),
float is 64(VSR), but for int and float vector register both are 64(VSR). So there should be 2 kinds of register class when vsx is enabled,
and 3 kinds of register class when VSX is NOT enabled.

It runs on POWER target, it makes big(+~30%) performance improvement in one specific bmk(503.bwaves_r) of spec2017 and no other obvious degressions.

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

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

5 years ago[ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap.
Chen Zheng [Tue, 8 Oct 2019 03:00:31 +0000 (03:00 +0000)]
[ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap.

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

5 years ago[WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll
Heejin Ahn [Tue, 8 Oct 2019 02:50:27 +0000 (02:50 +0000)]
[WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll

This was missing in D68552.

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

5 years ago[LitConfig] Silenced notes/warnings on quiet.
Andrew Trick [Tue, 8 Oct 2019 01:31:02 +0000 (01:31 +0000)]
[LitConfig] Silenced notes/warnings on quiet.

Lit has a "quiet" option, -q, which is documented to "suppress no
error output". Previously, LitConfig displayed notes and warnings when
the quiet option was specified. The result was that it was not
possible to get only pertinent file/line information to be used by an
editor to jump to the location where checks were failing without
passing a number of unhelpful locations first. Here, the
implementations of LitConfig.note and LitConfig.warning are modified
to account for the quiet flag and avoid displaying if the flag has
indeed been set.

Patch by Nate Chandler

Reviewed by yln

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

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

5 years agoAMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources
Matt Arsenault [Mon, 7 Oct 2019 23:33:08 +0000 (23:33 +0000)]
AMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources

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

5 years ago[Attributor][NFC] Add debug output
Johannes Doerfert [Mon, 7 Oct 2019 23:30:04 +0000 (23:30 +0000)]
[Attributor][NFC] Add debug output

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

5 years ago[Attributor][FIX] Remove initialize calls and add undefs
Johannes Doerfert [Mon, 7 Oct 2019 23:28:54 +0000 (23:28 +0000)]
[Attributor][FIX] Remove initialize calls and add undefs

The initialization logic has become part of the Attributor but the
patches that introduced these calls here were in development when the
transition happened.

We also now clean up (undefine) the macros used to create attributes.

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

5 years ago[Attributor] Use local linkage instead of internal
Johannes Doerfert [Mon, 7 Oct 2019 23:21:52 +0000 (23:21 +0000)]
[Attributor] Use local linkage instead of internal

Local linkage is internal or private, and private is a specialization of
internal, so either is fine for all our "local linkage" queries.

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

5 years ago[Attributor] Use abstract call sites for call site callback
Johannes Doerfert [Mon, 7 Oct 2019 23:14:58 +0000 (23:14 +0000)]
[Attributor] Use abstract call sites for call site callback

Summary:
When we iterate over uses of functions and expect them to be call sites,
we now use abstract call sites to allow callback calls.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, hfinkel, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Shrink zero extends of gather indices from type less than i32 to types larger...
Craig Topper [Mon, 7 Oct 2019 23:03:12 +0000 (23:03 +0000)]
[X86] Shrink zero extends of gather indices from type less than i32 to types larger than i32.

Gather instructions can use i32 or i64 elements for indices. If
the index is zero extended from a type smaller than i32 to i64, we
can shrink the extend to just extend to i32.

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

5 years ago[X86] Add test cases for zero extending a gather index from less than i32 to i64.
Craig Topper [Mon, 7 Oct 2019 23:02:03 +0000 (23:02 +0000)]
[X86] Add test cases for zero extending a gather index from less than i32 to i64.

We should be able to use a smaller zero extend.

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

5 years agoFix the spelling of my name.
Joerg Sonnenberger [Mon, 7 Oct 2019 22:55:42 +0000 (22:55 +0000)]
Fix the spelling of my name.

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

5 years ago[X86] Add new calling convention that guarantees tail call optimization
Reid Kleckner [Mon, 7 Oct 2019 22:28:58 +0000 (22:28 +0000)]
[X86] Add new calling convention that guarantees tail call optimization

When the target option GuaranteedTailCallOpt is specified, calls with
the fastcc calling convention will be transformed into tail calls if
they are in tail position. This diff adds a new calling convention,
tailcc, currently supported only on X86, which behaves the same way as
fastcc, except that the GuaranteedTailCallOpt flag does not need to
enabled in order to enable tail call optimization.

Patch by Dwight Guth <dwight.guth@runtimeverification.com>!

Reviewed By: lebedev.ri, paquette, rnk

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

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

5 years ago[WebAssembly] Fix unwind mismatch stat computation
Heejin Ahn [Mon, 7 Oct 2019 22:19:40 +0000 (22:19 +0000)]
[WebAssembly] Fix unwind mismatch stat computation

Summary:
There was a bug when computing the number of unwind destination
mismatches in CFGStackify. When there are many mismatched calls that
share the same (original) destination BB, they have to be counted
separately.

This also fixes a typo and runs `fixUnwindMismatches` only when the wasm
exception handling is enabled. This is to prevent unnecessary
computations and does not change behavior.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[llvm-lipo] Add TextAPI to LINK_COMPONENTS
Heejin Ahn [Mon, 7 Oct 2019 22:11:30 +0000 (22:11 +0000)]
[llvm-lipo] Add TextAPI to LINK_COMPONENTS

Summary:
D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
with `-DBUILD_SHARED_LIBS=ON` fail.

Reviewers: alexshap

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[Attributor][FIX] Remove assertion wrong for on invalid IRPositions
Johannes Doerfert [Mon, 7 Oct 2019 21:48:08 +0000 (21:48 +0000)]
[Attributor][FIX] Remove assertion wrong for on invalid IRPositions

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

5 years ago[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro
Cameron McInally [Mon, 7 Oct 2019 21:33:39 +0000 (21:33 +0000)]
[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro

Note that we are not sure where the tests for these functions lives. This was discussed in the Phab Diff.

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

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

5 years ago[WebAssembly] Add memory intrinsics handling to mayThrow()
Heejin Ahn [Mon, 7 Oct 2019 21:14:45 +0000 (21:14 +0000)]
[WebAssembly] Add memory intrinsics handling to mayThrow()

Summary:
Previously, `WebAssembly::mayThrow()` assumed all inputs are global
addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
are lowered to external symbols in instruction selection and later
emitted as library calls. And these functions don't throw.

This patch adds handling to those memory intrinsics to `mayThrow`
function. But while most of libcalls don't throw, we can't guarantee all
of them don't throw, so currently we conservatively return true for all
other external symbols.

I think a better way to solve this problem is to embed 'nounwind' info
in `TargetLowering::CallLoweringInfo`, so that we can access the info
from the backend. This will also enable transferring 'nounwind'
properties of LLVM IR instructions. Currently we don't transfer that
info and we can only access properties of callee functions, if the
callees are within the module. Other targets don't need this info in the
backend because they do all the processing before isel, but it will help
us because that info will reduce code size increase in fixing unwind
destination mismatches in CFGStackify.

But for now we return false for these memory intrinsics and true for all
other libcalls conservatively.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[llvm-lipo] Relax the check of the specified input file architecture
Alexander Shaposhnikov [Mon, 7 Oct 2019 21:14:22 +0000 (21:14 +0000)]
[llvm-lipo] Relax the check of the specified input file architecture

cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly.

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

Test plan: make check-all

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

5 years ago[Attributor] Deduce memory behavior of functions and arguments
Johannes Doerfert [Mon, 7 Oct 2019 21:07:57 +0000 (21:07 +0000)]
[Attributor] Deduce memory behavior of functions and arguments

Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract...
Roman Lebedev [Mon, 7 Oct 2019 20:53:27 +0000 (20:53 +0000)]
[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)

This can come up in Bit Stream abstractions.

The pattern looks big/scary, but it can't be simplified any further.
It only is so simple because a number of my preparatory folds had
happened already (shift amount reassociation / shift amount
reassociation in bit test, sign bit test detection).

Highlights:
* There are two main flavors: https://rise4fun.com/Alive/zWi
  The difference is add vs. sub, and left-shift of -1 vs. 1
* Since we only change the shift opcode,
  we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
* There can be truncation after high-bit-extraction:
  https://rise4fun.com/Alive/slHc1   (the main pattern i'm after!)
  Which means that we need to ignore zext of shift amounts and of NBits.
* The sign-extending magic can be extended itself (in add pattern
  via sext, in sub pattern via zext. not the other way around!)
  https://rise4fun.com/Alive/NhG
  (or those sext/zext can be sinked into `select`!)
  Which again means we should pay attention when matching NBits.
* We can have both truncation of extraction and widening of magic:
  https://rise4fun.com/Alive/XTw
  In other words, i don't believe we need to have any checks on
  bitwidths of any of these constructs.

This is worsened in general by the fact that we may have `sext` instead
of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
although we should. I have not done anything about that here.

Also, we really should have something to weed out `sub` like these,
by folding them into `add` variant.

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

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

5 years ago[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern...
Roman Lebedev [Mon, 7 Oct 2019 20:53:16 +0000 (20:53 +0000)]
[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)

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

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

5 years ago[InstCombine] Move isSignBitCheck(), handle rest of the predicates
Roman Lebedev [Mon, 7 Oct 2019 20:53:08 +0000 (20:53 +0000)]
[InstCombine] Move isSignBitCheck(), handle rest of the predicates

True, no test coverage is being added here. But those non-canonical
predicates that are already handled here already have no test coverage
as far as i can tell. I tried to add tests for them, but all the patterns
already get handled elsewhere.

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

5 years ago[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with...
Roman Lebedev [Mon, 7 Oct 2019 20:53:00 +0000 (20:53 +0000)]
[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask

Summary:
Currently, we pre-check whether we need to produce a mask or not.
This involves some rather magical constants.
I'd like to extend this fold to also handle the situation
when there's also a `trunc` before outer shift.
That will require another set of magical constants.
It's ugly.

Instead, we can just compute the mask, and check
whether mask is a pass-through (all-ones) or not.
This way we don't need to have any magical numbers.

This change is NFC other than the fact that we now compute
the mask and then check if we need (and can!) apply it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts
Roman Lebedev [Mon, 7 Oct 2019 20:52:52 +0000 (20:52 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts

Summary:
When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
which means that for patterns a/b we'd assume that we must not produce
any bits for that channel, while in reality we simply didn't care
about that channel - i.e. we don't need to mask it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG
Cameron McInally [Mon, 7 Oct 2019 20:41:25 +0000 (20:41 +0000)]
[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG

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

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

5 years ago[AccelTable] Remove stale comment (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:33:20 +0000 (20:33 +0000)]
[AccelTable] Remove stale comment (NFC)

rdar://55857228

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

5 years agogn build: try to make system-libs.windows.test pass
Nico Weber [Mon, 7 Oct 2019 19:17:02 +0000 (19:17 +0000)]
gn build: try to make system-libs.windows.test pass

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

5 years agoAMDGPU/GlobalISel: Handle more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 19:16:26 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Handle more G_INSERT cases

Start manually writing a table to get the subreg index. TableGen
should probably generate this, but I'm not sure what it looks like in
the arbitrary case where subregisters are allowed to not fully cover
the super-registers.

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

5 years agoGlobalISel: Partially implement lower for G_INSERT
Matt Arsenault [Mon, 7 Oct 2019 19:13:27 +0000 (19:13 +0000)]
GlobalISel: Partially implement lower for G_INSERT

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

5 years agoAMDGPU/GlobalISel: Fix selection of 16-bit shifts
Matt Arsenault [Mon, 7 Oct 2019 19:10:44 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Fix selection of 16-bit shifts

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

5 years agoAMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32
Matt Arsenault [Mon, 7 Oct 2019 19:10:43 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32

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

5 years agoAMDGPU/GlobalISel: Use S_MOV_B64 for inline constants
Matt Arsenault [Mon, 7 Oct 2019 19:07:19 +0000 (19:07 +0000)]
AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants

This hides some defects in SIFoldOperands when the immediates are
split.

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

5 years agoAMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources
Matt Arsenault [Mon, 7 Oct 2019 19:05:58 +0000 (19:05 +0000)]
AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources

Continue making a mess of merge/unmerge legality.

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

5 years agoAMDGPU/GlobalISel: Select more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 18:43:31 +0000 (18:43 +0000)]
AMDGPU/GlobalISel: Select more G_INSERT cases

At minimum handle the s64 insert type, which are emitted in real cases
during legalization.

We really need TableGen to emit something to emit something like the
inverse of composeSubRegIndices do determine the subreg index to use.

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

5 years agoGlobalISel: Add target pre-isel instructions
Matt Arsenault [Mon, 7 Oct 2019 18:43:29 +0000 (18:43 +0000)]
GlobalISel: Add target pre-isel instructions

Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.

Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.

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

5 years agoSecond attempt to add iterator_range::empty()
Jordan Rose [Mon, 7 Oct 2019 18:14:24 +0000 (18:14 +0000)]
Second attempt to add iterator_range::empty()

Doing this makes MSVC complain that `empty(someRange)` could refer to
either C++17's std::empty or LLVM's llvm::empty, which previously we
avoided via SFINAE because std::empty is defined in terms of an empty
member rather than begin and end. So, switch callers over to the new
method as it is added.

https://reviews.llvm.org/D68439

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

5 years agoFix Calling Convention through aliases
Erich Keane [Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)]
Fix Calling Convention through aliases

r369697 changed the behavior of stripPointerCasts to no longer include
aliases.  However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.

The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.

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

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

5 years ago[Remarks] Pass StringBlockValue as StringRef.
Florian Hahn [Mon, 7 Oct 2019 17:05:09 +0000 (17:05 +0000)]
[Remarks] Pass StringBlockValue as StringRef.

After changing the remark serialization, we now pass StringRefs to the
serializer. We should use StringRef for StringBlockVal, to avoid
creating temporary objects, which then cause StringBlockVal.Value to
point to invalid memory.

Reviewers: thegameg, anemet

Reviewed By: thegameg

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

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

5 years agoFix build errors caused by rL373914.
Wei Mi [Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)]
Fix build errors caused by rL373914.

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

5 years ago[llvm-profdata] Minor format fix
Wenlei He [Mon, 7 Oct 2019 16:30:31 +0000 (16:30 +0000)]
[llvm-profdata] Minor format fix

Summary: Minor format fix for output of "llvm-profdata -show"

Reviewers: wmi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 16:15:20 +0000 (16:15 +0000)]
[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.

Stop all the callers from having to check the value type before calling getTargetShuffleInputs.

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

5 years ago[SampleFDO] Add compression support for any section in ExtBinary profile format
Wei Mi [Mon, 7 Oct 2019 16:12:37 +0000 (16:12 +0000)]
[SampleFDO] Add compression support for any section in ExtBinary profile format

Previously ExtBinary profile format only supports compression using zlib for
profile symbol list. In this patch, we extend the compression support to any
section. User can select some or all of the sections to compress. In an
experiment, for a 45M profile in ExtBinary format, compressing name table
reduced its size to 24M, and compressing all the sections reduced its size
to 11M.

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

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

5 years ago[LoopVectorize] add test that asserted after cost model change (PR43582); NFC
Sanjay Patel [Mon, 7 Oct 2019 14:48:27 +0000 (14:48 +0000)]
[LoopVectorize] add test that asserted after cost model change (PR43582); NFC

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

5 years agoAllow update_test_checks.py to not scrub names.
David Greene [Mon, 7 Oct 2019 14:37:20 +0000 (14:37 +0000)]
Allow update_test_checks.py to not scrub names.

Add a --preserve-names option to tell the script not to replace IR names.
Sometimes tests want those names.  For example if a test is looking for a
modification to an existing instruction we'll want to make the names.

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

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

5 years agoFix another sphinx warning.
Kevin P. Neal [Mon, 7 Oct 2019 14:14:46 +0000 (14:14 +0000)]
Fix another sphinx warning.

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

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

5 years agoRegenerate ptr-rotate.ll . NFC
Amaury Sechet [Mon, 7 Oct 2019 14:10:21 +0000 (14:10 +0000)]
Regenerate ptr-rotate.ll . NFC

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

5 years ago[Mips] Always save RA when disabling frame pointer elimination
Simon Atanasyan [Mon, 7 Oct 2019 14:01:37 +0000 (14:01 +0000)]
[Mips] Always save RA when disabling frame pointer elimination

This ensures that frame-based unwinding will continue to work when
calling a noreturn function; there is not much use having the caller's
frame pointer saved if you don't also have the caller's program counter.

Patch by James Clarke.

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

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

5 years ago[Mips] Fix evaluating J-format branch targets
Simon Atanasyan [Mon, 7 Oct 2019 14:01:22 +0000 (14:01 +0000)]
[Mips] Fix evaluating J-format branch targets

J/JAL/JALX/JALS are absolute branches, but stay within the current
256 MB-aligned region, so we must include the high bits of the
instruction address when calculating the branch target.

Patch by James Clarke.

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

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

5 years ago[LLVM-C] Add bindings to create macro debug info
whitequark [Mon, 7 Oct 2019 13:57:13 +0000 (13:57 +0000)]
[LLVM-C] Add bindings to create macro debug info

Summary: The C API doesn't have the bindings to create macro debug information.

Reviewers: whitequark, CodaFi, deadalnix

Reviewed By: whitequark

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoFix sphinx warnings.
Kevin P. Neal [Mon, 7 Oct 2019 13:39:56 +0000 (13:39 +0000)]
Fix sphinx warnings.

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

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

5 years agoTest commit
Mirko Brkusanin [Mon, 7 Oct 2019 13:23:12 +0000 (13:23 +0000)]
Test commit

Fix comment.

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

5 years ago[FPEnv] Add constrained intrinsics for lrint and lround
Kevin P. Neal [Mon, 7 Oct 2019 13:20:00 +0000 (13:20 +0000)]
[FPEnv] Add constrained intrinsics for lrint and lround

Earlier in the year intrinsics for lrint, llrint, lround and llround were
added to llvm. The constrained versions are now implemented here.

Reviewed by: andrew.w.kaylor, craig.topper, cameron.mcinally
Approved by: craig.topper
Differential Revision: https://reviews.llvm.org/D64746

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

5 years agogn build: use better triple on windows
Nico Weber [Mon, 7 Oct 2019 13:13:31 +0000 (13:13 +0000)]
gn build: use better triple on windows

The CMake build uses "x86_64-pc-windows-msvc". The "-msvc" suffix is
important because e.g. clang/test/lit.cfg.py matches against the
suffix "windows-msvc" to compute the presence of the "ms-sdk" and
the absence of the "LP64" feature.

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

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

5 years agoRevert r373888 "[IA] Recognize hexadecimal escape sequences"
Nico Weber [Mon, 7 Oct 2019 11:46:26 +0000 (11:46 +0000)]
Revert r373888 "[IA] Recognize hexadecimal escape sequences"

It broke MC/AsmParser/directive_ascii.s on all bots:

    Assertion failed: (Index < Length && "Invalid index!"), function operator[],
        file ../../llvm/include/llvm/ADT/StringRef.h, line 243.

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

5 years ago[AMDGPU] Fix test checks
Jay Foad [Mon, 7 Oct 2019 10:57:41 +0000 (10:57 +0000)]
[AMDGPU] Fix test checks

The GFX10-DENORM-STRICT checks were only passing by accident. Fix them
to make the test more robust in the face of scheduling or register
allocation changes.

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

5 years ago[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG...
George Rimar [Mon, 7 Oct 2019 10:29:38 +0000 (10:29 +0000)]
[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.

This patch:

* Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do not have any)
* Enables dumping of SHT_LLVM_ADDRSIG with --all.
* Changes the logic to report a warning instead of an error when something goes wrong during dumping
  (allows to continue dumping SHT_LLVM_ADDRSIG and other sections on error).
* Refactors a piece of logic to a new toULEB128Array helper which might be used for GNU-style
  dumping implementation.

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

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

5 years ago[IA] Recognize hexadecimal escape sequences
Bill Wendling [Mon, 7 Oct 2019 09:54:53 +0000 (09:54 +0000)]
[IA] Recognize hexadecimal escape sequences

Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.

Reviewers: nickdesaulniers

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[TableGen] Pacify gcc-5.4 more
James Molloy [Mon, 7 Oct 2019 08:23:20 +0000 (08:23 +0000)]
[TableGen] Pacify gcc-5.4 more

Followup to a previous pacification, this performs the same workaround
to the TableGen generated code for tuple automata.

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

5 years agoRevert "[SLP] avoid reduction transform on patterns that the backend can load-combine"
Martin Storsjo [Mon, 7 Oct 2019 08:21:37 +0000 (08:21 +0000)]
Revert "[SLP] avoid reduction transform on patterns that the backend can load-combine"

This reverts SVN r373833, as it caused a failed assert "Non-zero loop
cost expected" on building numerous projects, see PR43582 for details
and reproduction samples.

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

5 years ago[llvm-locstats] Fix a typo in the documentation; NFC
Djordje Todorovic [Mon, 7 Oct 2019 07:31:49 +0000 (07:31 +0000)]
[llvm-locstats] Fix a typo in the documentation; NFC

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

5 years ago[X86] Autogenerate checks in leaFixup32.mir and leaFixup64.mir. NFC
Craig Topper [Mon, 7 Oct 2019 06:50:56 +0000 (06:50 +0000)]
[X86] Autogenerate checks in leaFixup32.mir and leaFixup64.mir. NFC

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

5 years ago[X86] Support LEA64_32r in processInstrForSlow3OpLEA and use INC/DEC when possible.
Craig Topper [Mon, 7 Oct 2019 06:27:55 +0000 (06:27 +0000)]
[X86] Support LEA64_32r in processInstrForSlow3OpLEA and use INC/DEC when possible.

Move the erasing and iterator updating inside to match the
other slow LEA function.

I've adapted code from optTwoAddrLEA and basically rebuilt the
implementation here. We do lose the kill flags now just like
optTwoAddrLEA. This runs late enough in the pipeline that
shouldn't really be a problem.

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

5 years ago[NFC][CGP] Tests for making ICMP_EQ use CR result of ICMP_S(L|G)T dominators
Yi-Hong Lyu [Mon, 7 Oct 2019 05:29:11 +0000 (05:29 +0000)]
[NFC][CGP] Tests for making ICMP_EQ use CR result of ICMP_S(L|G)T dominators

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

5 years agogn build: no-op style tweak in sync script
Nico Weber [Mon, 7 Oct 2019 00:37:10 +0000 (00:37 +0000)]
gn build: no-op style tweak in sync script

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

5 years ago[Docs] Removes Subsystem Documentation page
DeForest Richards [Sun, 6 Oct 2019 22:49:22 +0000 (22:49 +0000)]
[Docs] Removes Subsystem Documentation page

Removes Subsystem Documentation page. Also moves existing topics on Subsystem Documentation page to User Guides and Reference pages.

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

5 years ago[X86][AVX] Access a scalar float/double as a free extract from a broadcast load ...
Simon Pilgrim [Sun, 6 Oct 2019 21:11:45 +0000 (21:11 +0000)]
[X86][AVX] Access a scalar float/double as a free extract from a broadcast load (PR43217)

If a fp scalar is loaded and then used as both a scalar and a vector broadcast, perform the load as a broadcast and then extract the scalar for 'free' from the 0th element.

This involved switching the order of the X86ISD::BROADCAST combines so we only convert to X86ISD::BROADCAST_LOAD once all other canonicalizations have been attempted.

Adds a DAGCombinerInfo::recursivelyDeleteUnusedNodes wrapper.

Fixes PR43217

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

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

5 years agoFix signed/unsigned warning. NFCI
Simon Pilgrim [Sun, 6 Oct 2019 19:54:20 +0000 (19:54 +0000)]
Fix signed/unsigned warning. NFCI

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

5 years ago[NFC][PowerPC] Reorganize CRNotPat multiclass patterns in PPCInstrInfo.td
Amy Kwan [Sun, 6 Oct 2019 19:45:53 +0000 (19:45 +0000)]
[NFC][PowerPC] Reorganize CRNotPat multiclass patterns in PPCInstrInfo.td

This is patch aims to group together the `CRNotPat` multi class instantiations
within the `PPCInstrInfo.td` file.

Integer instantiations of the multi class are grouped together into a section,
and the floating point patterns are separated into its own section.

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

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

5 years ago[X86][SSE] Remove resolveTargetShuffleInputs and use getTargetShuffleInputs directly.
Simon Pilgrim [Sun, 6 Oct 2019 19:07:00 +0000 (19:07 +0000)]
[X86][SSE] Remove resolveTargetShuffleInputs and use getTargetShuffleInputs directly.

Move the resolveTargetShuffleInputsAndMask call to after the shuffle mask combine before the undef/zero constant fold instead.

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

5 years ago[X86][SSE] Don't merge known undef/zero elements into target shuffle masks.
Simon Pilgrim [Sun, 6 Oct 2019 19:06:45 +0000 (19:06 +0000)]
[X86][SSE] Don't merge known undef/zero elements into target shuffle masks.

Replaces setTargetShuffleZeroElements with getTargetShuffleAndZeroables which reports the Zeroable elements but doesn't merge them into the decoded target shuffle mask (the merging has been moved up into getTargetShuffleInputs until we can get rid of it entirely).

This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle mask isn't adjusted by its source inputs but instead we cache them in a parallel Zeroable mask.

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

5 years ago[X86] Add custom type legalization for v16i64->v16i8 truncate and v8i64->v8i8 truncat...
Craig Topper [Sun, 6 Oct 2019 18:43:08 +0000 (18:43 +0000)]
[X86] Add custom type legalization for v16i64->v16i8 truncate and v8i64->v8i8 truncate when v8i64 isn't legal

Summary:
The default legalization for v16i64->v16i8 tries to create a multiple stage truncate concatenating after each stage and truncating again. But avx512 implements truncates with multiple uops. So it should be better to truncate all the way to the desired element size and then concatenate the pieces using unpckl instructions. This minimizes the number of 2 uop truncates. The unpcks are all single uop instructions.

I tried to handle this by just custom splitting the v16i64->v16i8 shuffle. And hoped that the DAG combiner would leave the two halves in the state needed to make D68374 do the job for each half. This worked for the first half, but the second half got messed up. So I've implemented custom handling for v8i64->v8i8 when v8i64 needs to be split to produce the VTRUNCs directly.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[LegalizeTypes][X86] When splitting a vselect for type legalization, don't split...
Craig Topper [Sun, 6 Oct 2019 18:43:03 +0000 (18:43 +0000)]
[LegalizeTypes][X86] When splitting a vselect for type legalization, don't split a setcc condition if the setcc input is legal and vXi1 conditions are supported

Summary: The VSELECT splitting code tries to split a setcc input as well. But on avx512 where mask registers are well supported it should be better to just split the mask and use a single compare.

Reviewers: RKSimon, spatel, efriedma

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agogn build: make windows build less broken
Nico Weber [Sun, 6 Oct 2019 18:11:53 +0000 (18:11 +0000)]
gn build: make windows build less broken

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

5 years ago[LOOPGUARD] Remove asserts in getLoopGuardBranch
Whitney Tsang [Sun, 6 Oct 2019 16:39:43 +0000 (16:39 +0000)]
[LOOPGUARD] Remove asserts in getLoopGuardBranch
Summary: The assertion in getLoopGuardBranch can be a 'return nullptr'
under if condition.
Authored By: DTharun
Reviewer: Whitney, fhahn
Reviewed By: Whitney, fhahn
Subscribers: fhahn, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66084

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

5 years ago[Docs] Removes Programming Documentation page
DeForest Richards [Sun, 6 Oct 2019 16:10:11 +0000 (16:10 +0000)]
[Docs] Removes Programming Documentation page

Removes Programming Documentation page. Also moves existing topics on Programming Documentation page to User Guides and Reference pages.

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

5 years ago[X86][SSE] resolveTargetShuffleInputs - call getTargetShuffleInputs instead of using...
Simon Pilgrim [Sun, 6 Oct 2019 15:42:25 +0000 (15:42 +0000)]
[X86][SSE] resolveTargetShuffleInputs - call getTargetShuffleInputs instead of using setTargetShuffleZeroElements directly. NFCI.

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

5 years ago[Docs] Adds new Getting Started/Tutorials page
DeForest Richards [Sun, 6 Oct 2019 15:36:37 +0000 (15:36 +0000)]
[Docs] Adds new Getting Started/Tutorials page

Adds a new page for Getting Started/Tutorials topics. Also updates existing topic categories on the User Guides and Reference pages.

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

5 years agoRevert [DAGCombine] Match more patterns for half word bswap
Sanjay Patel [Sun, 6 Oct 2019 15:27:34 +0000 (15:27 +0000)]
Revert [DAGCombine] Match more patterns for half word bswap

This reverts r373850 (git commit 25ba49824d2d4f2347b4a7cb1623600a76ce9433)

This patch appears to cause multiple codegen regression test failures - http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10680

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

5 years ago[NFC] Replace 'isDarwin' with 'IsDarwin'
Xiangling Liao [Sun, 6 Oct 2019 14:44:22 +0000 (14:44 +0000)]
[NFC] Replace 'isDarwin' with 'IsDarwin'

Summary: Replace 'isDarwin' with 'IsDarwin' based on LLVM naming convention.

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

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

5 years ago[InstCombine] fold fneg disguised as select+fmul (PR43497)
Sanjay Patel [Sun, 6 Oct 2019 14:15:48 +0000 (14:15 +0000)]
[InstCombine] fold fneg disguised as select+fmul (PR43497)

Extends rL373230 and solves the motivating bug (although in a narrow way):
https://bugs.llvm.org/show_bug.cgi?id=43497

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

5 years ago[DAGCombine] Match more patterns for half word bswap
Amaury Sechet [Sun, 6 Oct 2019 14:14:55 +0000 (14:14 +0000)]
[DAGCombine] Match more patterns for half word bswap

Summary: It ensures that the bswap is generated even when a part of the subtree already matches a bswap transform.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

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