1 ; RUN: opt < %s -memcpyopt -disable-output
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 @b = common dso_local local_unnamed_addr global i32 0, align 4
7 @a = common dso_local local_unnamed_addr global i32 0, align 4
9 declare dso_local i32 @f1()
11 ; Do not crash due to store first in BB.
12 define dso_local void @f2() {
14 %0 = load i32, i32* @b, align 4
18 store i32 %1, i32* @a, align 4
19 %call = call i32 @f1()
20 %cmp = icmp sge i32 %call, 0
21 %1 = load i32, i32* @b, align 4
25 ; Do not crash due to call not before store in BB.
26 define dso_local void @f3() {
28 %0 = load i32, i32* @b, align 4
33 store i32 %1, i32* @a, align 4
34 %call = call i32 @f1()
35 %cmp = icmp sge i32 %call, 0
36 %1 = load i32, i32* @b, align 4