1 ; RUN: llc %s -o - -O1 -debug-only=consthoist 2>&1 | FileCheck %s
4 target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
5 target triple = "thumbv6m-apple-ios8.0.0"
9 ; CHECK: Collect constant i32 -3 from call void @g(i32 -3) with cost 2
10 define void @f(i1 %cond) {
13 br i1 %cond, label %true, label %ret
24 ; CHECK-NOT: Collect constant i32 -193 from
25 define void @h(i1 %cond, i32 %p, i32 %q) {
27 %a = and i32 %p, 4294967103
29 br i1 %cond, label %true, label %ret
32 %b = and i32 %q, 4294967103
40 ; CHECK: Function: test_icmp_neg
41 ; CHECK-NOT: Collect constant
42 define void @test_icmp_neg(i1 %cond, i32 %arg, i32 %arg2) {
44 %a = icmp ne i32 %arg, -5
46 br i1 %cond, label %true, label %ret
49 %b = icmp ne i32 %arg2, -5
58 ; CHECK: Function: test_icmp_neg2
59 ; CHECK: Hoist constant (i32 -500) to BB entry
60 define void @test_icmp_neg2(i1 %cond, i32 %arg, i32 %arg2) {
62 %a = icmp ne i32 %arg, -500
64 br i1 %cond, label %true, label %ret
67 %b = icmp ne i32 %arg2, -500
75 ; CHECK: Function: test_add_neg
76 ; CHECK-NOT: Collect constant i32 -5
77 define void @test_add_neg(i1 %cond, i32 %arg, i32 %arg2) {
81 br i1 %cond, label %true, label %ret
84 %b = add i32 %arg2, -5