blob: 5d1aa821ea1ba5d60cfc169102e1b02dd1f0b84b [file] [log] [blame]
Andrew Kaylor647025f2017-06-09 23:18:11 +00001; RUN: opt < %s -instcombine -S | FileCheck %s
2
3declare double @acos(double)
4
5; Check that functions without any function attributes are simplified.
6
7define double @test_simplify_acos() {
8; CHECK-LABEL: @test_simplify_acos
9 %pi = call double @acos(double -1.000000e+00)
10; CHECK-NOT: call double @acos
11; CHECK: ret double 0x400921FB54442D18
12 ret double %pi
13}
14
Andrew Kaylor53a5fbb2017-08-14 21:15:13 +000015; Check that we don't constant fold builtin functions.
16
Andrew Kaylor647025f2017-06-09 23:18:11 +000017define double @test_acos_nobuiltin() {
18; CHECK-LABEL: @test_acos_nobuiltin
19 %pi = call double @acos(double -1.000000e+00) nobuiltin
20; CHECK: call double @acos(double -1.000000e+00)
21 ret double %pi
22}
Andrew Kaylor53a5fbb2017-08-14 21:15:13 +000023
24; Check that we don't constant fold strictfp results that require rounding.
25
26define double @test_acos_strictfp() {
27; CHECK-LABEL: @test_acos_strictfp
28 %pi = call double @acos(double -1.000000e+00) strictfp
29; CHECK: call double @acos(double -1.000000e+00)
30 ret double %pi
31}