diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2015-11-16 20:23:25 +0300 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2015-11-16 20:23:25 +0300 |
commit | 2ac938e6e76bb07b0fcb6ab761808c7d5d945c96 (patch) | |
tree | 4bd478c0be0ec1f273195955365d5ed404998655 | |
parent | 3296a833b9417b78436c447756c029e2647f2478 (diff) |
Merging r243731:
------------------------------------------------------------------------
r243731 | Matthew.Arsenault | 2015-07-31 00:12:04 -0400 (Fri, 31 Jul 2015) | 2 lines
AMDGPU: Fix v16i32 to v16i8 truncstore
------------------------------------------------------------------------
llvm-svn: 253231
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/AMDGPU/trunc-store.ll | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 099b0b15942b..25798c42a8c9 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -157,6 +157,7 @@ SITargetLowering::SITargetLowering(TargetMachine &TM, setTruncStoreAction(MVT::i64, MVT::i32, Expand); setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand); + setTruncStoreAction(MVT::v16i32, MVT::v16i8, Expand); setTruncStoreAction(MVT::v16i32, MVT::v16i16, Expand); setOperationAction(ISD::LOAD, MVT::i1, Custom); diff --git a/llvm/test/CodeGen/AMDGPU/trunc-store.ll b/llvm/test/CodeGen/AMDGPU/trunc-store.ll new file mode 100644 index 000000000000..4ba815f26690 --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/trunc-store.ll @@ -0,0 +1,48 @@ +; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s +; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s + +; FUNC-LABEL: {{^}}truncstore_arg_v16i32_to_v16i8: +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +define void @truncstore_arg_v16i32_to_v16i8(<16 x i8> addrspace(1)* %out, <16 x i32> %in) { + %trunc = trunc <16 x i32> %in to <16 x i8> + store <16 x i8> %trunc, <16 x i8> addrspace(1)* %out + ret void +} + +; FUNC-LABEL: {{^}}truncstore_arg_v16i64_to_v16i8: +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +; SI: buffer_store_byte +define void @truncstore_arg_v16i64_to_v16i8(<16 x i8> addrspace(1)* %out, <16 x i64> %in) { + %trunc = trunc <16 x i64> %in to <16 x i8> + store <16 x i8> %trunc, <16 x i8> addrspace(1)* %out + ret void +} |