<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [AArch64] continue merging consecutive stores when the next store has different type in store sequences"
href="https://llvm.org/bugs/show_bug.cgi?id=27816">27816</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[AArch64] continue merging consecutive stores when the next store has different type in store sequences
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: AArch64
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>junbuml@codeaurora.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>In test case below, the consecutive i8 stores are merged into a i64 store.
However, if there is different type of store at the end of the chain which is
commented below, it will not merge other possible stores.
%struct.A = type { i8, i8, i8, i8, i8, i8, i8, i8, i32 }
define void @merge_const_store(i32 %count, %struct.A* nocapture %p) {
%1 = icmp sgt i32 %count, 0
br i1 %1, label %.lr.ph, label %._crit_edge
.lr.ph:
%i.02 = phi i32 [ %add, %.lr.ph ], [ 0, %0 ]
%.01 = phi %struct.A* [ %addr, %.lr.ph ], [ %p, %0 ]
%a2 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 0
store i8 1, i8* %a2, align 1
%a3 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 1
store i8 2, i8* %a3, align 1
%a4 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 2
store i8 3, i8* %a4, align 1
%a5 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 3
store i8 4, i8* %a5, align 1
%a6 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 4
store i8 5, i8* %a6, align 1
%a7 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 5
store i8 6, i8* %a7, align 1
%a8 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 6
store i8 7, i8* %a8, align 1
%a9 = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 7
store i8 8, i8* %a9, align 1
;;;;;;;;;;;;
; If we uncomment this i32 store, above 8 stores will not merged.
;%addr_last = getelementptr inbounds %struct.A, %struct.A* %.01, i64 0, i32 8
;store i32 0, i32* %addr_last, align 4
;;;;;;;;;;;;
%add = add nsw i32 %i.02, 1
%addr = getelementptr inbounds %struct.A, %struct.A* %.01, i64 1
%exitcond = icmp eq i32 %add, %count
br i1 %exitcond, label %._crit_edge, label %.lr.ph
._crit_edge:
ret void
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>