xref: /llvm-project/llvm/test/Transforms/Inline/inline-drop-attributes.ll (revision 1bb929833b18db4a26a4d145d7270597cb5d48ce)
1*1bb92983SAntonio Frighetto; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2*1bb92983SAntonio Frighetto; RUN: opt < %s -passes=inline -S | FileCheck %s
3*1bb92983SAntonio Frighetto; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
4*1bb92983SAntonio Frighetto
5*1bb92983SAntonio Frighettodefine void @callee() {
6*1bb92983SAntonio Frighetto; CHECK-LABEL: define void @callee() {
7*1bb92983SAntonio Frighetto; CHECK-NEXT:  entry:
8*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[VAL_PTR:%.*]] = load ptr, ptr null, align 8
9*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[VAL_PTR]], null
10*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[VAL:%.*]] = load i64, ptr null, align 8
11*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[CMP]], i64 undef, i64 [[VAL]]
12*1bb92983SAntonio Frighetto; CHECK-NEXT:    ret void
13*1bb92983SAntonio Frighetto;
14*1bb92983SAntonio Frighettoentry:
15*1bb92983SAntonio Frighetto  %val_ptr = load ptr, ptr null, align 8
16*1bb92983SAntonio Frighetto  %cmp = icmp eq ptr %val_ptr, null
17*1bb92983SAntonio Frighetto  %val = load i64, ptr null, align 8
18*1bb92983SAntonio Frighetto  %sel = select i1 %cmp, i64 undef, i64 %val
19*1bb92983SAntonio Frighetto  ret void
20*1bb92983SAntonio Frighetto}
21*1bb92983SAntonio Frighetto
22*1bb92983SAntonio Frighettodefine noundef i1 @caller() {
23*1bb92983SAntonio Frighetto; CHECK-LABEL: define noundef i1 @caller() {
24*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[VAL_PTR_I:%.*]] = load ptr, ptr null, align 8
25*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[CMP_I:%.*]] = icmp eq ptr [[VAL_PTR_I]], null
26*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[VAL_I:%.*]] = load i64, ptr null, align 8
27*1bb92983SAntonio Frighetto; CHECK-NEXT:    [[SEL_I:%.*]] = select i1 [[CMP_I]], i64 undef, i64 [[VAL_I]]
28*1bb92983SAntonio Frighetto; CHECK-NEXT:    ret i1 false
29*1bb92983SAntonio Frighetto;
30*1bb92983SAntonio Frighetto  call void @callee()
31*1bb92983SAntonio Frighetto  ret i1 false
32*1bb92983SAntonio Frighetto}
33