Commit Graph

1788 Commits

Author SHA1 Message Date
Matt Arsenault 7c299a76cf AMDGPU: Fix tests using old number for constant address space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341770 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10 02:54:25 +00:00
Matt Arsenault 814247cd96 AMDGPU: Use GOT PSV since it has an address space now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341768 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10 02:23:39 +00:00
Matt Arsenault 185f21fbd3 AMDGPU: Don't abort on unknown addrspace argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-10 02:23:30 +00:00
Alexander Timofeev 55e56ce884 [AMDGPU] Preliminary patch for divergence driven instruction selection. Fold immediate SMRD offset.
Differential revision: https://reviews.llvm.org/D51610

Reviewer: rampitec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341636 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 09:05:34 +00:00
Scott Linder 63ca6b52d5 Revert r341413
Causes a regression in expensive checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341589 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 21:38:56 +00:00
Scott Linder 6da9a35885 [AMDGPU] Legalize VGPR Rsrc operands for MUBUF instructions
Emit a waterfall loop in the general case for a potentially-divergent Rsrc
operand. When practical, avoid this by using Addr64 instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341413 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 21:50:47 +00:00
Matt Arsenault 49cbe528e3 AMDGPU: Fix DAG divergence not reporting flat loads
Match behavior in DAG of r340343

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341393 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 18:58:19 +00:00
Matt Arsenault 24b52d3cc6 DAG: Handle extract_vector_elt in isKnownNeverNaN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-03 14:01:03 +00:00
Tom Stellard 051c613085 AMDGPU/GlobalISel: Define instruction mapping for G_SELECT
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341271 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-01 02:41:19 +00:00
Stanislav Mekhanoshin 44c99af37e [AMDGPU] Split v32i32 loads
Differential Revision: https://reviews.llvm.org/D51555

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341266 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 22:43:36 +00:00
Matt Arsenault 6241a83e35 AMDGPU: Restrict extract_vector_elt combine to loads
The intention is to enable the extract_vector_elt load combine,
and doing this for other operations interferes with more
useful optimizations on vectors.

Handle any type of load since in principle we should do the
same combine for the various load intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341219 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 15:39:52 +00:00
Matt Arsenault 9ee1996724 AMDGPU: Actually commit re-run of update_llc_test_checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341218 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 15:05:06 +00:00
Matt Arsenault d3da33bf59 AMDGPU: Fix broken generated check lines
This was incorrectly using the same check prefix for multiple lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341214 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 14:34:22 +00:00
Matt Arsenault 54c2fe982a AMDGPU: Remove obsolete tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341169 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 06:07:45 +00:00
Matt Arsenault c8c005cb52 AMDGPU: Stop forcing internalize at -O0
This doesn't really matter if clang is always emitting
the visibility as hidden by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341168 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 06:02:36 +00:00
Matt Arsenault 7e212e4168 AMDGPU: Remove remnants of old address space mapping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341165 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 05:49:54 +00:00
Alexander Timofeev c851af3c8a [AMDGPU] Preliminary patch for divergence driven instruction selection. Operands Folding 1.
Reviewers: rampitec

Differential revision: https://reviews/llvm/org/D51316

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341068 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 13:55:04 +00:00
Matt Arsenault da1abaaf13 Don't count debug instructions towards neighborhood count
In computeRegisterLiveness, the max instructions to search
was counting dbg_value instructions, which could potentially
cause an observable codegen change from the presence of debug
info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341028 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 07:18:19 +00:00
Matt Arsenault f29f15e2ea CodeGen: Make computeRegisterLiveness search forward first
If there is an unused def, this would previously
report that the register was live. Check for uses
first so that it is reported as dead if never used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341027 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 07:18:10 +00:00
Matt Arsenault 23c93c1752 CodeGen: Make computeRegisterLiveness consider successors
If the end of the block is reached during the scan, check
the live ins of the successors. This was already done in the
other direction if the block entry was reached.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341026 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 07:17:51 +00:00
Matt Arsenault 0dc6b313f6 DAG: Don't use ABI copies in some contexts
If an ABI-like value is used in a different block,
the type split used is not necessarily the same as
the call's ABI. The value is used through an intermediate
copy virtual registers from the other block. This
resulted in copies with inconsistent sizes later.

Fixes regressions since r338197 when AMDGPU started
splitting vector types for calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341018 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 05:49:28 +00:00
Marek Olsak 8ce430e181 AMDGPU: Handle 32-bit address wraparounds for SMRD opcodes
Summary: This fixes GPU hangs with OpenGL bindless handle arithmetic.

Reviewers: arsenm, nhaehnle

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340959 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 20:03:00 +00:00
Farhana Aleen 056d9c0c1f [AMDGPU] Match udot4 pattern.
Summary: D.u32 = S0.u8[0] * S1.u8[0] +
                 S0.u8[1] * S1.u8[1] +
                 S0.u8[2] * S1.u8[2] +
                 S0.u8[3] * S1.u8[3] + S2.u32

Author: FarhanaAleen

Reviewed By: arsenm

Subscribers: llvm-commits, AMDGPU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340936 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 16:31:18 +00:00
Nicolai Haehnle 1209b727bc AMDGPU: Fix getInstSizeInBytes
Summary:
Add some optional code to validate getInstSizeInBytes for emitted
instructions. This flushed out some issues which are fixed by this
patch:

- Streamline getInstSizeInBytes
- Properly define the VI readlane/writelane instruction as VOP3
- Fix the inline constant determination. Specifically, this change
  fixes an issue where a 32-bit value of 0xffffffff was recorded
  as unsigned. This is equal to -1 when restricting to a 32-bit
  comparison, and an inline constant can be used.

Reviewers: arsenm, rampitec

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

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

Change-Id: Id87c3b7975839da0de8156a124b0ce98c5fb47f2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340903 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 07:46:09 +00:00
Matt Arsenault 29213a71a3 AMDGPU: Don't delete instructions if S_ENDPGM has implicit uses
This can leave behind the uses with the defs removed.
Since this should only really happen in tests, it's not worth the
effort of trying to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340866 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 18:55:55 +00:00
Matt Arsenault 0e21fb6c46 AMDGPU: Force shrinking of add/sub even if the carry is used
The original motivating example uses a 64-bit add, so the carry
is used. Insert a copy from VCC. This may allow shrinking of
the used carry instruction. At worst, we are replacing a
mov to materialize the constant with a copy of vcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340862 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 18:44:16 +00:00
Matt Arsenault ac00e8c95b AMDGPU: Shrink insts to fold immediates
This needs to be done in the SSA fold operands
pass to be effective, so there is a bit of overlap
with SIShrinkInstructions but I don't think this
is practically avoidable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340859 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 18:34:24 +00:00
Ryan Taylor da360ea600 [AMDGPU] Add support for a16 modifiear for gfx9
Summary:
Adding support for a16 for gfx9. A16 bit replaces r128 bit for gfx9.

Change-Id: Ie8b881e4e6d2f023fb5e0150420893513e5f4841

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340831 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 15:07:30 +00:00
Craig Topper 00ca244b7d [DAGCombiner][AMDGPU][Mips] Fold bitcast with volatile loads if the resulting load is legal for the target.
Summary:
I'm not sure if this patch is correct or if it needs more qualifying somehow. Bitcast shouldn't change the size of the load so it should be ok? We already do something similar for stores. We'll change the type of a volatile store if the resulting store is Legal or Custom. I'm not sure we should be allowing Custom there...

I was playing around with converting X86 atomic loads/stores(except seq_cst) into regular volatile loads and stores during lowering. This would allow some special RMW isel patterns in X86InstrCompiler.td to be removed. But there's some floating point patterns in there that didn't work because we don't fold (f64 (bitconvert (i64 volatile load))) or (f32 (bitconvert (i32 volatile load))).

Reviewers: efriedma, atanasyan, arsenm

Reviewed By: efriedma

Subscribers: jvesely, arsenm, sdardis, kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, arichardson, jrtc27, atanasyan, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340797 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 03:47:20 +00:00
Matt Arsenault bfb50d8dbc DAG: Check transformed type for forming fminnum/fmaxnum from vselect
Follow up to r340655 to fix vector types which are split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340766 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 18:11:31 +00:00
Matt Arsenault 9b313de7bb MachineVerifier: Fix assert on implicit virtreg use
If the liveness of a physical register was invalid, this
was attempting to iterate the subregisters of all register
uses of the instruction, which would assert when it
encountered an implicit virtual register operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 17:40:09 +00:00
Tim Renouf ee9a2bdfd5 [AMDGPU] Add support for multi-dword s.buffer.load intrinsic
Summary:
Patch by Marek Olsak and David Stuttard, both of AMD.

This adds a new amdgcn intrinsic supporting s.buffer.load, in particular
multiple dword variants. These are convenient to use from some front-end
implementations.

Also modified the existing llvm.SI.load.const intrinsic to common up the
underlying implementation.

This modification also requires that we can lower to non-uniform loads correctly
by splitting larger dword variants into sizes supported by the non-uniform
versions of the load.

V2: Addressed minor review comments.
V3: i1 glc is now i32 cachepolicy for consistency with buffer and
    tbuffer intrinsics, plus fixed formatting issue.
V4: Added glc test.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: I83a6e00681158bb243591a94a51c7baa445f169b

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340684 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-25 14:53:17 +00:00
Matt Arsenault 936b78d214 DAG: Allow matching fminnum/fmaxnum from vselect
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 21:24:18 +00:00
Tim Renouf 17b68c25c6 [RegisterCoalescer] Fix for assert in removePartialRedundancy
Summary:
I got "Use not jointly dominated by defs" when removePartialRedundancy
attempted to prune then re-extend a subrange whose only liveness was a
dead def at the copy being removed.

V2: Removed junk from test. Improved comment.
V3: Addressed minor review comments.

Subscribers: MatzeB, qcolombet, nhaehnle, llvm-commits

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

Change-Id: I6f894e9f517f71e921e0c6d81d28c5f344db8dad

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340549 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 17:28:33 +00:00
Samuel Pitoiset 7226e5bf26 AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space
32-bit constant address space is declared as 6, so the
maximum number of address spaces is 6, not 5.

Fixes "LLVM ERROR: Pointer address space out of range".

v5: rename MAX_COMMON_ADDRESS to MAX_AMDGPU_ADDRESS
v4: - fix compilation issues
    - fix out of bounds access
v3: use static_assert()
v2: add a very simple test for 32-bit addr space

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106630

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340417 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 16:08:48 +00:00
Samuel Pitoiset 8ea5abf0df AMDGPU: fix existing alias rules for constant and global
Constant and global may alias, also one rules table wasn't
ordered correctly.

Pinpointed by Matt.

v2: add a test with swapped parameters

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 16:08:43 +00:00
Matt Arsenault ad45fb5af4 AMDGPU: Fix not respecting byval alignment in call frame setup
This was hackily adding in the 4-bytes reserved for the callee's
emergency stack slot. Treat it like a normal stack allocation
so we get the correct alignment padding behavior. This fixes
an inconsistency between the caller and callee.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340396 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 11:09:45 +00:00
Farhana Aleen cf8aa848ec [AMDGPU] Support idot2 pattern.
Summary: Transform add (mul ((i32)S0.x, (i32)S1.x),

         add( mul ((i32)S0.y, (i32)S1.y), (i32)S3) => i/udot2((v2i16)S0, (v2i16)S1, (i32)S3)

Author: FarhanaAleen

Reviewed By: arsenm

Subscribers: llvm-commits, AMDGPU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340295 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 16:21:15 +00:00
Tim Renouf 0c432687f9 [AMDGPU] Allow int types for MUBUF vdata
Summary:
Previously the new llvm.amdgcn.raw/struct.buffer.load/store intrinsics
only allowed float types for the data to be loaded or stored, which
sometimes meant the frontend needed to generate a bitcast. In this, the
new intrinsics copied the old buffer intrinsics.

This commit extends the new intrinsics to allow int types as well.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: I8202af2d036455553681dcbb3d7d32ae273f8f85

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340270 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 11:08:12 +00:00
Tim Renouf a53b9eb46e [AMDGPU] New buffer intrinsics
Summary:
This commit adds new intrinsics
  llvm.amdgcn.raw.buffer.load
  llvm.amdgcn.raw.buffer.load.format
  llvm.amdgcn.raw.buffer.load.format.d16
  llvm.amdgcn.struct.buffer.load
  llvm.amdgcn.struct.buffer.load.format
  llvm.amdgcn.struct.buffer.load.format.d16
  llvm.amdgcn.raw.buffer.store
  llvm.amdgcn.raw.buffer.store.format
  llvm.amdgcn.raw.buffer.store.format.d16
  llvm.amdgcn.struct.buffer.store
  llvm.amdgcn.struct.buffer.store.format
  llvm.amdgcn.struct.buffer.store.format.d16
  llvm.amdgcn.raw.buffer.atomic.*
  llvm.amdgcn.struct.buffer.atomic.*

with the following changes from the llvm.amdgcn.buffer.*
intrinsics:

* there are separate raw and struct versions: raw does not have an
  index arg and sets idxen=0 in the instruction, and struct always sets
  idxen=1 in the instruction even if the index is 0, to allow for the
  fact that gfx9 does bounds checking differently depending on whether
  idxen is set;

* there is a combined cachepolicy arg (glc+slc)

* there are now only two offset args: one for the offset that is
  included in bounds checking and swizzling, to be split between the
  instruction's voffset and immoffset fields, and one for the offset
  that is excluded from bounds checking and swizzling, to go into the
  instruction's soffset field.

The AMDISD::BUFFER_* SD nodes always have an index operand, all three
offset operands, combined cachepolicy operand, and an extra idxen
operand.

The obsolescent llvm.amdgcn.buffer.* intrinsics continue to work.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, jfb, llvm-commits

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

Change-Id: If897ea7dc34fcbf4d5496e98cc99a934f62fc205

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340269 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 11:07:10 +00:00
Tim Renouf 12c4e30c78 [AMDGPU] New tbuffer intrinsics
Summary:
This commit adds new intrinsics
  llvm.amdgcn.raw.tbuffer.load
  llvm.amdgcn.struct.tbuffer.load
  llvm.amdgcn.raw.tbuffer.store
  llvm.amdgcn.struct.tbuffer.store

with the following changes from the llvm.amdgcn.tbuffer.* intrinsics:

* there are separate raw and struct versions: raw does not have an index
  arg and sets idxen=0 in the instruction, and struct always sets
  idxen=1 in the instruction even if the index is 0, to allow for the
  fact that gfx9 does bounds checking differently depending on whether
  idxen is set;

* there is a combined format arg (dfmt+nfmt)

* there is a combined cachepolicy arg (glc+slc)

* there are now only two offset args: one for the offset that is
  included in bounds checking and swizzling, to be split between the
  instruction's voffset and immoffset fields, and one for the offset
  that is excluded from bounds checking and swizzling, to go into the
  instruction's soffset field.

The AMDISD::TBUFFER_* SD nodes always have an index operand, all three
offset operands, combined format operand, combined cachepolicy operand,
and an extra idxen operand.

The tbuffer pseudo- and real instructions now also have a combined
format operand.

The obsolescent llvm.amdgcn.tbuffer.* and llvm.SI.tbuffer.store
intrinsics continue to work.

V2: Separate raw and struct intrinsics.
V3: Moved extract_glc and extract_slc defs to a more sensible place.
V4: Rebased on D49995.
V5: Only two separate offset args instead of three.
V6: Pseudo- and real instructions have joint format operand.
V7: Restored optionality of dfmt and nfmt in assembler.
V8: Addressed minor review comments.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: If22ad77e349fac3a5d2f72dda53c010377d470d4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340268 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 11:06:05 +00:00
Vitaly Buka 70a5f27583 Revert "AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space"
As it introduces out of bound access.

This reverts commit r340172 and r340171

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340202 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 19:31:03 +00:00
Samuel Pitoiset 52379849f9 AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space
32-bit constant address space is declared as 6, so the
maximum number of address spaces is 6, not 5.

Fixes "LLVM ERROR: Pointer address space out of range".

v3: use static_assert()
v2: add a very simple test for 32-bit addr space

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106630
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340171 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 13:18:59 +00:00
Matt Arsenault a0d83d520e AMDGPU: Custom lower fexp
This will allow the library to just use __builtin_expf directly
without expanding this itself. Note f64 still won't work because
there is no exp instruction for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339902 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 17:07:52 +00:00
Matt Arsenault d82cfba790 AMDGPU: Fold fneg into fmed3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339821 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:46:27 +00:00
Matt Arsenault 6030329f4b AMDGPU: Improve extract_vector_elt reduction combine
Handle fmul, fsub and preserve flags.

Also really test minnum/maxnum reductions.
The existing tests were only checking from
minnum/maxnum matched from a fast math compare
and select which is not the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339820 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:34:06 +00:00
Matt Arsenault 5f9b848ed3 AMDGPU: Implement llvm.amdgcn.icmp/fcmp for i16/f16
Also support these on targets without support for these,
since it will allow us to freely create these in instcombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339819 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:25:20 +00:00
Matt Arsenault abf0ee059c AMDGPU: Address todo for handling 1/(2 pi)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339814 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 21:03:55 +00:00
Scott Linder 7b19ab70e3 [CodeGen] Fix assert in SelectionDAG::computeKnownBits
Fix SelectionDAG::computeKnownBits asserting when handling EXTRACT_SUBVECTOR
when zero extending the demanded elements mask if it is already as long as the
source vector.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:44:21 +00:00
Matt Arsenault 1f25a887f6 AMDGPU: Cleanup min/max legacy tests
Also add some more tests in preparation for
a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339526 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-12 19:29:53 +00:00