summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2016-07-11 22:34:29 +0000
committerAlina Sbirlea <asbirlea@google.com>2016-07-11 22:34:29 +0000
commitcbc6ac2afd7b4837040831892ebff1ed538e13e5 (patch)
tree134064156fa5bfcdeedcbb3a4f3e15768443fc00 /llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll
parent3e0361710a035f000fb24d434743268fe40f4c08 (diff)
downloadbcm5719-llvm-cbc6ac2afd7b4837040831892ebff1ed538e13e5.tar.gz
bcm5719-llvm-cbc6ac2afd7b4837040831892ebff1ed538e13e5.zip
Correct ordering of loads/stores.
Summary: Aiming to correct the ordering of loads/stores. This patch changes the insert point for loads to the position of the first load. It updates the ordering method for loads to insert before, rather than after. Before this patch the following sequence: "load a[1], store a[1], store a[0], load a[2]" Would incorrectly vectorize to "store a[0,1], load a[1,2]". The correctness check was assuming the insertion point for loads is at the position of the first load, when in practice it was at the last load. An alternative fix would have been to invert the correctness check. The current fix changes insert position but also requires reordering of instructions before the vectorized load. Updated testcases to reflect the changes. Reviewers: tstellarAMD, llvm-commits, jlebar, arsenm Subscribers: mzolotukhin Differential Revision: http://reviews.llvm.org/D22071 llvm-svn: 275117
Diffstat (limited to 'llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll')
-rw-r--r--llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll b/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll
index c6bde5dfe15..64a0480d8d3 100644
--- a/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll
+++ b/llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/insertion-point.ll
@@ -2,13 +2,13 @@
target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-p24:64:64-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
-; Check relative position of the inserted vector load relative to the
-; existing adds.
+; Check relative position of the inserted vector load relative to the existing
+; adds. Vectorized loads should be inserted at the position of the first load.
; CHECK-LABEL: @insert_load_point(
; CHECK: %z = add i32 %x, 4
-; CHECK: %w = add i32 %y, 9
; CHECK: load <2 x float>
+; CHECK: %w = add i32 %y, 9
; CHECK: %foo = add i32 %z, %w
define void @insert_load_point(float addrspace(1)* nocapture %a, float addrspace(1)* nocapture %b, float addrspace(1)* nocapture readonly %c, i64 %idx, i32 %x, i32 %y) #0 {
entry:
OpenPOWER on IntegriCloud