1 ; RUN: llc -mtriple=aarch64-none-linux-gnu %s -o - -O1 -debug-only=consthoist 2>&1 | FileCheck %s
8 ; CHECK-NOT: Collect constant
9 define void @f1(i1 %cond) {
12 br i1 %cond, label %true, label %ret
22 ; Constant is 0xBEEF000000000000, single MOVZ with shift.
24 ; CHECK-NOT: Collect constant
25 define void @f2(i1 %cond, i64 %p, i64 %q) {
27 %a = and i64 %p, 13758215386640154624
29 br i1 %cond, label %true, label %ret
32 %b = and i64 %q, 13758215386640154624
41 ; CHECK: Collect constant i64 4294967103 from %a = and i64 %p, 4294967103 with cost 2
42 define void @f3(i1 %cond, i64 %p, i64 %q) {
44 %a = and i64 %p, 4294967103
46 br i1 %cond, label %true, label %ret
49 %b = and i64 %q, 4294967103
58 ; Collect constant i64 -4688528683866062848 from %a = and i64 %p, -4688528683866062848 with cost 2
59 define void @f4(i1 %cond, i64 %p, i64 %q) {
61 %a = and i64 %p, 13758215389843488768
63 br i1 %cond, label %true, label %ret
66 %b = and i64 %q, 13758215389843488768
75 ; Collect constant i64 88994925642865 from %a = and i64 %p, 88994925642865 with cost 3
76 define void @f5(i1 %cond, i64 %p, i64 %q) {
78 %a = and i64 %p, 88994925642865
80 br i1 %cond, label %true, label %ret
83 %b = and i64 %q, 88994925642865
92 ; Collect constant i64 -4688439692143754127 from %b = and i64 %q, -4688439692143754127 with cost 4
93 define void @f6(i1 %cond, i64 %p, i64 %q) {
95 %a = and i64 %p, 13758304381565797489
97 br i1 %cond, label %true, label %ret
100 %b = and i64 %q, 13758304381565797489