1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -S -passes=ipsccp | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
8 ; CHECK-LABEL: define {{[^@]+}}@fn2()
10 ; CHECK-NEXT: [[CONV:%.*]] = sext i32 undef to i64
11 ; CHECK-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]]
12 ; CHECK-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]])
13 ; CHECK-NEXT: ret i64 [[CALL2]]
16 %conv = sext i32 undef to i64
17 %div = sdiv i64 8, %conv
18 %call2 = call i64 @fn1(i64 %div)
22 define internal i64 @fn1(i64 %p1) {
23 ; CHECK-LABEL: define {{[^@]+}}@fn1
24 ; CHECK-SAME: (i64 [[P1:%.*]])
26 ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i64 [[P1]], 0
27 ; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i64 [[P1]], i64 [[P1]]
28 ; CHECK-NEXT: ret i64 [[COND]]
31 %tobool = icmp ne i64 %p1, 0
32 %cond = select i1 %tobool, i64 %p1, i64 %p1