2 ; RUN: opt -S -passes='function(instsimplify),hotcoldsplit' -hotcoldsplit-threshold=-1 -debug < %s 2>&1 | FileCheck %s
3 ; RUN: opt -passes='function(instcombine),hotcoldsplit,function(instsimplify)' %s -o /dev/null
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64"
12 ; CHECK-LABEL: codeRepl:
13 ; CHECK-NOT: @llvm.assume
15 ; CHECK: declare {{.*}}@llvm.assume
16 ; CHECK: define {{.*}}@f.cold.1(i64 %load1)
17 ; CHECK-LABEL: newFuncRoot:
18 ; CHECK: %cmp1 = icmp eq i64 %load1, 0
19 ; CHECK-NOT: call void @llvm.assume
20 ; CHECK: define {{.*}}@f.cold.2()
21 ; CHECK-LABEL: newFuncRoot:
26 %i = getelementptr inbounds %a, ptr null, i64 0, i32 1
29 label: ; preds = %entry
30 %load0 = load ptr, ptr %i, align 8
31 %i3 = getelementptr inbounds %b, ptr %load0, i64 undef, i32 0
32 %load1 = load i64, ptr %i3, align 8
33 %cmp0 = icmp ugt i64 %load1, 1
34 br i1 %cmp0, label %if.then, label %if.else
36 if.then: ; preds = %label
39 if.else: ; preds = %label
40 call void @g(ptr undef)
41 %load2 = load i64, ptr undef, align 8
42 %i7 = and i64 %load2, -16
43 %i8 = inttoptr i64 %i7 to ptr
44 %cmp1 = icmp eq i64 %load1, 0
45 call void @llvm.assume(i1 %cmp1)
51 declare void @llvm.assume(i1 noundef) #0
53 attributes #0 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }