1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost -no-ir-sim-intrinsics < %s | FileCheck %s
4 ; This test checks that we do not outline memset intrinsics since it requires
5 ; extra address space checks.
7 declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i32, i1)
9 define i64 @function1(i64 %x, i64 %z, i64 %n) {
10 ; CHECK-LABEL: @function1(
12 ; CHECK-NEXT: [[POOL:%.*]] = alloca [59 x i64], align 4
13 ; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr nonnull align 4 [[POOL]], i8 0, i64 236, i1 false)
14 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[N:%.*]], i64 [[X:%.*]], i64 [[Z:%.*]])
15 ; CHECK-NEXT: ret i64 0
18 %pool = alloca [59 x i64], align 4
19 call void @llvm.memset.p0.i64(ptr nonnull %pool, i8 0, i64 236, i32 4, i1 false)
20 %cmp3 = icmp eq i64 %n, 0
26 define i64 @function2(i64 %x, i64 %z, i64 %n) {
27 ; CHECK-LABEL: @function2(
29 ; CHECK-NEXT: [[POOL:%.*]] = alloca [59 x i64], align 4
30 ; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr nonnull align 4 [[POOL]], i8 0, i64 236, i1 false)
31 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[N:%.*]], i64 [[X:%.*]], i64 [[Z:%.*]])
32 ; CHECK-NEXT: ret i64 0
35 %pool = alloca [59 x i64], align 4
36 call void @llvm.memset.p0.i64(ptr nonnull %pool, i8 0, i64 236, i32 4, i1 false)
37 %cmp3 = icmp eq i64 %n, 0