[llvm] r300559 - Add base-index-based store merge test
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 18 08:12:14 PDT 2017
Author: niravd
Date: Tue Apr 18 10:12:13 2017
New Revision: 300559
URL: http://llvm.org/viewvc/llvm-project?rev=300559&view=rev
Log:
Add base-index-based store merge test
Modified:
llvm/trunk/test/CodeGen/X86/merge_store.ll
Modified: llvm/trunk/test/CodeGen/X86/merge_store.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/merge_store.ll?rev=300559&r1=300558&r2=300559&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/merge_store.ll (original)
+++ llvm/trunk/test/CodeGen/X86/merge_store.ll Tue Apr 18 10:12:13 2017
@@ -28,3 +28,34 @@ entry:
for.end:
ret void
}
+
+
+
+;; CHECK-LABEL: indexed-store-merge
+
+;; We should be able to merge the 4 consecutive stores.
+;; FIXMECHECK: movl $0, 2(%rsi,%rdi)
+
+;; CHECK: movb $0, 2(%rsi,%rdi)
+;; CHECK: movb $0, 3(%rsi,%rdi)
+;; CHECK: movb $0, 4(%rsi,%rdi)
+;; CHECK: movb $0, 5(%rsi,%rdi)
+;; CHECK: movb $0, (%rsi)
+define void @indexed-store-merge(i64 %p, i8* %v) {
+entry:
+ %p2 = add nsw i64 %p, 2
+ %v2 = getelementptr i8, i8* %v, i64 %p2
+ store i8 0, i8* %v2, align 2
+ %p3 = add nsw i64 %p, 3
+ %v3 = getelementptr i8, i8* %v, i64 %p3
+ store i8 0, i8* %v3, align 1
+ %p4 = add nsw i64 %p, 4
+ %v4 = getelementptr i8, i8* %v, i64 %p4
+ store i8 0, i8* %v4, align 2
+ %p5 = add nsw i64 %p, 5
+ %v5 = getelementptr i8, i8* %v, i64 %p5
+ store i8 0, i8* %v5, align 1
+ %v0 = getelementptr i8, i8* %v, i64 0
+ store i8 0, i8* %v0, align 2
+ ret void
+}
More information about the llvm-commits
mailing list