1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ;; Make sure internal constrained FP intrinsics still merge properly
3 ; RUN: opt -passes=mergefunc -S < %s | FileCheck %s
5 declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
7 define float @func1(float %a, float %b) {
8 ; CHECK-LABEL: define float @func1
9 ; CHECK-SAME: (float [[A:%.*]], float [[B:%.*]]) {
10 ; CHECK-NEXT: [[RESULT:%.*]] = call float @llvm.experimental.constrained.fadd.f32(float [[A]], float [[B]], metadata !"round.dynamic", metadata !"fpexcept.strict")
11 ; CHECK-NEXT: [[RESULT_2:%.*]] = call float @llvm.experimental.constrained.fadd.f32(float [[A]], float [[B]], metadata !"round.dynamic", metadata !"fpexcept.strict")
12 ; CHECK-NEXT: ret float [[RESULT]]
14 %result = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")
15 %result_2 = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")
19 define float @func2(float %a, float %b) {
20 ; CHECK-LABEL: define float @func2
21 ; CHECK-SAME: (float [[TMP0:%.*]], float [[TMP1:%.*]]) {
22 ; CHECK-NEXT: [[TMP3:%.*]] = tail call float @func1(float [[TMP0]], float [[TMP1]])
23 ; CHECK-NEXT: ret float [[TMP3]]
25 %result = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")
26 %result_2 = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")