blob: 8eecb3fd40aa0189e14da9e53e3261d0085f25b1 [file] [log] [blame]
Sanjay Patelc04b6f22015-03-11 15:12:32 +00001; RUN: opt < %s -inline -instcombine -S | FileCheck %s
2
3; PR22857: http://llvm.org/bugs/show_bug.cgi?id=22857
4; The inliner should not add an edge to an intrinsic and
5; then assert that it did not add an edge to an intrinsic!
6
Sanjay Patel683f2972016-01-11 22:34:19 +00007define float @foo(float %f1) {
Sanjay Patelc04b6f22015-03-11 15:12:32 +00008 %call = call float @bar(float %f1)
9 ret float %call
10
11; CHECK-LABEL: @foo(
Sanjay Patelfa54ace2015-12-14 21:59:03 +000012; CHECK-NEXT: call fast float @llvm.fabs.f32
Sanjay Patelc04b6f22015-03-11 15:12:32 +000013; CHECK-NEXT: ret float
14}
15
Sanjay Patel683f2972016-01-11 22:34:19 +000016define float @bar(float %f1) {
Sanjay Patelc04b6f22015-03-11 15:12:32 +000017 %call = call float @sqr(float %f1)
Sanjay Patel683f2972016-01-11 22:34:19 +000018 %call1 = call fast float @sqrtf(float %call)
Sanjay Patelc04b6f22015-03-11 15:12:32 +000019 ret float %call1
20}
21
Sanjay Patel683f2972016-01-11 22:34:19 +000022define float @sqr(float %f) {
Sanjay Patelc04b6f22015-03-11 15:12:32 +000023 %mul = fmul fast float %f, %f
24 ret float %mul
25}
26
Sanjay Patel683f2972016-01-11 22:34:19 +000027declare float @sqrtf(float)
Sanjay Patelc04b6f22015-03-11 15:12:32 +000028