brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 2f32ef9 Raw
57 lines · plain
1; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -S < %s | FileCheck %s2 3target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"4target triple = "thumbv8m.main-arm-none-eabi"5 6; CHECK-LABEL: uadd_overflow_too_far_cmp_dom7; CHECK-NOT: with.overflow.i328define i32 @uadd_overflow_too_far_cmp_dom(i32 %arg0) {9entry:10  %cmp = icmp ne i32 %arg0, 011  br i1 %cmp, label %if.else, label %if.then12 13if.then:14  call void @foo()15  br label %exit16 17if.else:18  call void @bar()19  br label %if.end20 21if.end:22  %dec = add nsw i32 %arg0, -123  br label %exit24 25exit:26  %res = phi i32 [ %arg0, %if.then ], [ %dec, %if.end ]27  ret i32 %res28}29 30; CHECK-LABEL: uadd_overflow_too_far_math_dom31; CHECK-NOT: with.overflow.i3232define i32 @uadd_overflow_too_far_math_dom(i32 %arg0, i32 %arg1) {33entry:34  %dec = add nsw i32 %arg0, -135  %cmp = icmp ugt i32 %arg0, 136  br i1 %cmp, label %if.else, label %if.then37 38if.then:39  call void @foo()40  br label %if.end41 42if.else:43  call void @bar()44  br label %if.end45 46if.end:47  %cmp.i.i = icmp ne i32 %arg0, 048  %tobool = zext i1 %cmp.i.i to i3249  br label %exit50 51exit:52  ret i32 %tobool53}54 55declare void @foo()56declare void @bar()57