diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-08-26 15:06:10 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-08-26 15:06:10 +0000 |
commit | edd08f74289c6ba3b3f8e730e4ab825ef9bd6492 (patch) | |
tree | cf3037b11ce6827bd2a1c3398d9e4c6b8b12b5a7 /test/CodeGen/R600 | |
parent | d08a9303614355cfdcac5f2c27c09ce809565423 (diff) | |
download | external_llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.zip external_llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.tar.gz external_llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.tar.bz2 |
SelectionDAG: Remove unnecessary uses of TargetLowering::getPointerTy()
If we have a binary operation like ISD:ADD, we can set the result type
equal to the result type of one of its operands rather than using
TargetLowering::getPointerTy().
Also, any use of DAG.getIntPtrConstant(C) as an operand for a binary
operation can be replaced with:
DAG.getConstant(C, OtherOperand.getValueType());
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600')
-rw-r--r-- | test/CodeGen/R600/load.ll | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/test/CodeGen/R600/load.ll b/test/CodeGen/R600/load.ll index 6cf1af7..c7fe611 100644 --- a/test/CodeGen/R600/load.ll +++ b/test/CodeGen/R600/load.ll @@ -467,6 +467,76 @@ entry: ret void } +; R600-CHECK: @load_v2i8_local +; R600-CHECK: LDS_UBYTE_READ_RET +; R600-CHECK: LDS_UBYTE_READ_RET +; SI-CHECK: @load_v2i8_local +; SI-CHECK: DS_READ_U8 +; SI-CHECK: DS_READ_U8 +define void @load_v2i8_local(<2 x i32> addrspace(1)* %out, <2 x i8> addrspace(3)* %in) { +entry: + %0 = load <2 x i8> addrspace(3)* %in + %1 = zext <2 x i8> %0 to <2 x i32> + store <2 x i32> %1, <2 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v2i8_sext_local +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; SI-CHECK: @load_v2i8_sext_local +; SI-CHECK: DS_READ_I8 +; SI-CHECK: DS_READ_I8 +define void @load_v2i8_sext_local(<2 x i32> addrspace(1)* %out, <2 x i8> addrspace(3)* %in) { +entry: + %0 = load <2 x i8> addrspace(3)* %in + %1 = sext <2 x i8> %0 to <2 x i32> + store <2 x i32> %1, <2 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v4i8_local +; R600-CHECK: LDS_UBYTE_READ_RET +; R600-CHECK: LDS_UBYTE_READ_RET +; R600-CHECK: LDS_UBYTE_READ_RET +; R600-CHECK: LDS_UBYTE_READ_RET +; SI-CHECK: @load_v4i8_local +; SI-CHECK: DS_READ_U8 +; SI-CHECK: DS_READ_U8 +; SI-CHECK: DS_READ_U8 +; SI-CHECK: DS_READ_U8 +define void @load_v4i8_local(<4 x i32> addrspace(1)* %out, <4 x i8> addrspace(3)* %in) { +entry: + %0 = load <4 x i8> addrspace(3)* %in + %1 = zext <4 x i8> %0 to <4 x i32> + store <4 x i32> %1, <4 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v4i8_sext_local +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: LDS_UBYTE_READ_RET +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; SI-CHECK: @load_v4i8_sext_local +; SI-CHECK: DS_READ_I8 +; SI-CHECK: DS_READ_I8 +; SI-CHECK: DS_READ_I8 +; SI-CHECK: DS_READ_I8 +define void @load_v4i8_sext_local(<4 x i32> addrspace(1)* %out, <4 x i8> addrspace(3)* %in) { +entry: + %0 = load <4 x i8> addrspace(3)* %in + %1 = sext <4 x i8> %0 to <4 x i32> + store <4 x i32> %1, <4 x i32> addrspace(1)* %out + ret void +} + ; Load an i16 value from the local address space. ; R600-CHECK: @load_i16_local ; R600-CHECK: LDS_USHORT_READ_RET @@ -493,6 +563,76 @@ entry: ret void } +; R600-CHECK: @load_v2i16_local +; R600-CHECK: LDS_USHORT_READ_RET +; R600-CHECK: LDS_USHORT_READ_RET +; SI-CHECK: @load_v2i16_local +; SI-CHECK: DS_READ_U16 +; SI-CHECK: DS_READ_U16 +define void @load_v2i16_local(<2 x i32> addrspace(1)* %out, <2 x i16> addrspace(3)* %in) { +entry: + %0 = load <2 x i16> addrspace(3)* %in + %1 = zext <2 x i16> %0 to <2 x i32> + store <2 x i32> %1, <2 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v2i16_sext_local +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; SI-CHECK: @load_v2i16_sext_local +; SI-CHECK: DS_READ_I16 +; SI-CHECK: DS_READ_I16 +define void @load_v2i16_sext_local(<2 x i32> addrspace(1)* %out, <2 x i16> addrspace(3)* %in) { +entry: + %0 = load <2 x i16> addrspace(3)* %in + %1 = sext <2 x i16> %0 to <2 x i32> + store <2 x i32> %1, <2 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v4i16_local +; R600-CHECK: LDS_USHORT_READ_RET +; R600-CHECK: LDS_USHORT_READ_RET +; R600-CHECK: LDS_USHORT_READ_RET +; R600-CHECK: LDS_USHORT_READ_RET +; SI-CHECK: @load_v4i16_local +; SI-CHECK: DS_READ_U16 +; SI-CHECK: DS_READ_U16 +; SI-CHECK: DS_READ_U16 +; SI-CHECK: DS_READ_U16 +define void @load_v4i16_local(<4 x i32> addrspace(1)* %out, <4 x i16> addrspace(3)* %in) { +entry: + %0 = load <4 x i16> addrspace(3)* %in + %1 = zext <4 x i16> %0 to <4 x i32> + store <4 x i32> %1, <4 x i32> addrspace(1)* %out + ret void +} + +; R600-CHECK: @load_v4i16_sext_local +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: LDS_USHORT_READ_RET +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; R600-CHECK-DAG: ASHR +; SI-CHECK: @load_v4i16_sext_local +; SI-CHECK: DS_READ_I16 +; SI-CHECK: DS_READ_I16 +; SI-CHECK: DS_READ_I16 +; SI-CHECK: DS_READ_I16 +define void @load_v4i16_sext_local(<4 x i32> addrspace(1)* %out, <4 x i16> addrspace(3)* %in) { +entry: + %0 = load <4 x i16> addrspace(3)* %in + %1 = sext <4 x i16> %0 to <4 x i32> + store <4 x i32> %1, <4 x i32> addrspace(1)* %out + ret void +} + ; load an i32 value from the glocal address space. ; R600-CHECK: @load_i32_local ; R600-CHECK: LDS_READ_RET |