1 ; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -S < %s | FileCheck %s
3 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
4 target triple = "thumbv8m.main-arm-none-eabi"
6 ; CHECK-LABEL: uadd_overflow_too_far_cmp_dom
7 ; CHECK-NOT: with.overflow.i32
8 define i32 @uadd_overflow_too_far_cmp_dom(i32 %arg0) {
10 %cmp = icmp ne i32 %arg0, 0
11 br i1 %cmp, label %if.else, label %if.then
22 %dec = add nsw i32 %arg0, -1
26 %res = phi i32 [ %arg0, %if.then ], [ %dec, %if.end ]
30 ; CHECK-LABEL: uadd_overflow_too_far_math_dom
31 ; CHECK-NOT: with.overflow.i32
32 define i32 @uadd_overflow_too_far_math_dom(i32 %arg0, i32 %arg1) {
34 %dec = add nsw i32 %arg0, -1
35 %cmp = icmp ugt i32 %arg0, 1
36 br i1 %cmp, label %if.else, label %if.then
47 %cmp.i.i = icmp ne i32 %arg0, 0
48 %tobool = zext i1 %cmp.i.i to i32