summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2019-02-22 16:00:19 +0000
committerNirav Dave <niravd@google.com>2019-02-22 16:00:19 +0000
commit44037d7a6377ec8e5542cced73583283334b516b (patch)
tree93af796311371909f55eea0320a2569d851b3b8a /llvm/test
parenta9e289174a1c21698ea0c1f1a43f1f504e5e75ef (diff)
downloadbcm5719-llvm-44037d7a6377ec8e5542cced73583283334b516b.tar.gz
bcm5719-llvm-44037d7a6377ec8e5542cced73583283334b516b.zip
[DAGCombine] Fold overlapping constant stores
Fold a smaller constant store into larger constant stores immediately preceeding it. Reviewers: rnk, courbet Subscribers: javed.absar, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58468 llvm-svn: 354676
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll4
-rw-r--r--llvm/test/CodeGen/PowerPC/constant-combines.ll18
-rw-r--r--llvm/test/CodeGen/X86/stores-merging.ll3
3 files changed, 9 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll b/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll
index ed72488f411..9bea40656b9 100644
--- a/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll
+++ b/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll
@@ -11,8 +11,8 @@ define i32 @main() local_unnamed_addr #1 {
; Make sure the stores happen in the correct order (the exact instructions could change).
; CHECK-LABEL: main:
-; CHECK: str xzr, [sp, #80]
-; CHECK: str w9, [sp, #80]
+; CHECK: orr w9, wzr, #0x1
+; CHECK: str x9, [sp, #80]
; CHECK: stp q0, q0, [sp, #48]
; CHECK: ldr w8, [sp, #48]
diff --git a/llvm/test/CodeGen/PowerPC/constant-combines.ll b/llvm/test/CodeGen/PowerPC/constant-combines.ll
index b959dc41fb0..bd14509e2ef 100644
--- a/llvm/test/CodeGen/PowerPC/constant-combines.ll
+++ b/llvm/test/CodeGen/PowerPC/constant-combines.ll
@@ -5,18 +5,15 @@
define void @fold_constant_stores_loaddr(i8* %i8_ptr) {
; BE-LABEL: fold_constant_stores_loaddr:
; BE: # %bb.0: # %entry
-; BE-NEXT: li 4, 0
+; BE-NEXT: li 4, 85
+; BE-NEXT: sldi 4, 4, 57
; BE-NEXT: std 4, 0(3)
-; BE-NEXT: li 4, -86
-; BE-NEXT: stb 4, 0(3)
; BE-NEXT: blr
;
; LE-LABEL: fold_constant_stores_loaddr:
; LE: # %bb.0: # %entry
-; LE-NEXT: li 4, 0
-; LE-NEXT: li 5, -86
+; LE-NEXT: li 4, 170
; LE-NEXT: std 4, 0(3)
-; LE-NEXT: stb 5, 0(3)
; LE-NEXT: blr
entry:
%i64_ptr = bitcast i8* %i8_ptr to i64*
@@ -29,18 +26,15 @@ entry:
define void @fold_constant_stores_hiaddr(i8* %i8_ptr) {
; BE-LABEL: fold_constant_stores_hiaddr:
; BE: # %bb.0: # %entry
-; BE-NEXT: li 4, 0
+; BE-NEXT: li 4, 85
+; BE-NEXT: sldi 4, 4, 57
; BE-NEXT: std 4, 0(3)
-; BE-NEXT: li 4, -86
-; BE-NEXT: stb 4, 0(3)
; BE-NEXT: blr
;
; LE-LABEL: fold_constant_stores_hiaddr:
; LE: # %bb.0: # %entry
-; LE-NEXT: li 4, 0
-; LE-NEXT: li 5, -86
+; LE-NEXT: li 4, 170
; LE-NEXT: std 4, 0(3)
-; LE-NEXT: stb 5, 0(3)
; LE-NEXT: blr
entry:
%i64_ptr = bitcast i8* %i8_ptr to i64*
diff --git a/llvm/test/CodeGen/X86/stores-merging.ll b/llvm/test/CodeGen/X86/stores-merging.ll
index eda7f3a2abf..25c93c3e7a2 100644
--- a/llvm/test/CodeGen/X86/stores-merging.ll
+++ b/llvm/test/CodeGen/X86/stores-merging.ll
@@ -26,9 +26,8 @@ define void @redundant_stores_merging() {
define void @redundant_stores_merging_reverse() {
; CHECK-LABEL: redundant_stores_merging_reverse:
; CHECK: # %bb.0:
-; CHECK-NEXT: movabsq $528280977409, %rax # imm = 0x7B00000001
+; CHECK-NEXT: movabsq $1958505086977, %rax # imm = 0x1C800000001
; CHECK-NEXT: movq %rax, e+{{.*}}(%rip)
-; CHECK-NEXT: movl $456, e+{{.*}}(%rip) # imm = 0x1C8
; CHECK-NEXT: retq
store i32 123, i32* getelementptr inbounds (%structTy, %structTy* @e, i64 0, i32 2), align 4
store i32 456, i32* getelementptr inbounds (%structTy, %structTy* @e, i64 0, i32 2), align 4
OpenPOWER on IntegriCloud