summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopLoadElim/forward.ll
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-01-06 21:06:51 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-01-06 21:06:51 +0000
commit27d224fbbb5185bb84df5535ff8682560796ee18 (patch)
treeb15f5c6dc2dd9ef0917306bf26fa019fd55532d8 /llvm/test/Transforms/LoopLoadElim/forward.ll
parent218ecacbf10a238ce2f71d620fa510c9aada0e73 (diff)
downloadbcm5719-llvm-27d224fbbb5185bb84df5535ff8682560796ee18.tar.gz
bcm5719-llvm-27d224fbbb5185bb84df5535ff8682560796ee18.zip
Fix LoopLoadElimination to keep original alignment on the inital hoisted store
This is fixing a bug where Loop Vectorization is widening a load but with a lower alignment. Hoisting the load without propagating the alignment will allow inst-combine to later deduce a higher alignment that what the pointer actually is. Differential Revision: https://reviews.llvm.org/D28408 llvm-svn: 291281
Diffstat (limited to 'llvm/test/Transforms/LoopLoadElim/forward.ll')
-rw-r--r--llvm/test/Transforms/LoopLoadElim/forward.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoopLoadElim/forward.ll b/llvm/test/Transforms/LoopLoadElim/forward.ll
index ed0d162ab7e..9a0e03a317c 100644
--- a/llvm/test/Transforms/LoopLoadElim/forward.ll
+++ b/llvm/test/Transforms/LoopLoadElim/forward.ll
@@ -16,8 +16,8 @@ define void @f(i32* %A, i32* %B, i32* %C, i64 %N) {
; CHECK-NOT: %found.conflict{{.*}} =
entry:
-; for.body.ph:
-; CHECK: %load_initial = load i32, i32* %A
+; Make sure the hoisted load keeps the alignment
+; CHECK: %load_initial = load i32, i32* %A, align 1
br label %for.body
for.body: ; preds = %for.body, %entry
@@ -34,7 +34,7 @@ for.body: ; preds = %for.body, %entry
%a_p1 = add i32 %b, 2
store i32 %a_p1, i32* %Aidx_next, align 4
- %a = load i32, i32* %Aidx, align 4
+ %a = load i32, i32* %Aidx, align 1
; CHECK: %c = mul i32 %store_forwarded, 2
%c = mul i32 %a, 2
store i32 %c, i32* %Cidx, align 4
OpenPOWER on IntegriCloud