summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/loadStore_vectorizer.ll
diff options
context:
space:
mode:
authorRoman Tereshin <rtereshin@apple.com>2018-07-19 19:42:43 +0000
committerRoman Tereshin <rtereshin@apple.com>2018-07-19 19:42:43 +0000
commitb49b2a601fc3c581aed1037389463a2ce63ece4d (patch)
tree53c863c0e6b773068cf288d71d216e561628d3f6 /llvm/test/CodeGen/X86/loadStore_vectorizer.ll
parent0c122d5a41cd038b8e29a0d8d671257938da1633 (diff)
downloadbcm5719-llvm-b49b2a601fc3c581aed1037389463a2ce63ece4d.tar.gz
bcm5719-llvm-b49b2a601fc3c581aed1037389463a2ce63ece4d.zip
[LSV] Refactoring + supporting bitcasts to a type of different size
This is mostly a preparation work for adding a limited support for select instructions. It proved to be difficult to do due to size and irregularity of Vectorizer::isConsecutiveAccess, this is fixed here I believe. It also turned out that these changes make it simpler to finish one of the TODOs and fix a number of other small issues, namely: 1. Looking through bitcasts to a type of a different size (requires careful tracking of the original load/store size and some math converting sizes in bytes to expected differences in indices of GEPs). 2. Reusing partial analysis of pointers done by first attempt in proving them consecutive instead of starting from scratch. This added limited support for nested GEPs co-existing with difficult sext/zext instructions. This also required a careful handling of negative differences between constant parts of offsets. 3. Handing a case where the first pointer index is not an add, but something else (a function parameter for instance). I observe an increased number of successful vectorizations on a large set of shader programs. Only few shaders are affected, but those that are affected sport >5% less loads and stores than before the patch. Reviewed By: rampitec Differential-Revision: https://reviews.llvm.org/D49342 llvm-svn: 337489
Diffstat (limited to 'llvm/test/CodeGen/X86/loadStore_vectorizer.ll')
-rw-r--r--llvm/test/CodeGen/X86/loadStore_vectorizer.ll18
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/loadStore_vectorizer.ll b/llvm/test/CodeGen/X86/loadStore_vectorizer.ll
index 03f6ccce6c4..48f31563c24 100644
--- a/llvm/test/CodeGen/X86/loadStore_vectorizer.ll
+++ b/llvm/test/CodeGen/X86/loadStore_vectorizer.ll
@@ -1,8 +1,9 @@
-; RUN: opt -load-store-vectorizer < %s -S | FileCheck %s
+; RUN: opt -mtriple x86_64-- -load-store-vectorizer < %s -S | FileCheck %s
%struct_render_pipeline_state = type opaque
-define fastcc void @main(%struct_render_pipeline_state addrspace(1)* %pso) unnamed_addr {
+define fastcc void @test1(%struct_render_pipeline_state addrspace(1)* %pso) unnamed_addr {
+; CHECK-LABEL: @test1
; CHECK: load i16
; CHECK: load i16
entry:
@@ -14,3 +15,16 @@ entry:
%tmp4 = load i16, i16 addrspace(1)* %tmp3, align 2
ret void
}
+
+define fastcc void @test2(%struct_render_pipeline_state addrspace(1)* %pso) unnamed_addr {
+; CHECK-LABEL: @test2
+; CHECK: load <2 x i16>
+entry:
+ %tmp = bitcast %struct_render_pipeline_state addrspace(1)* %pso to i16 addrspace(1)*
+ %tmp1 = load i16, i16 addrspace(1)* %tmp, align 2
+ %tmp2 = bitcast %struct_render_pipeline_state addrspace(1)* %pso to i8 addrspace(1)*
+ %sunkaddr51 = getelementptr i8, i8 addrspace(1)* %tmp2, i64 2
+ %tmp3 = bitcast i8 addrspace(1)* %sunkaddr51 to i16 addrspace(1)*
+ %tmp4 = load i16, i16 addrspace(1)* %tmp3, align 2
+ ret void
+}
OpenPOWER on IntegriCloud