[llvm] Fix: Distinguish CFI Metadata Checks in MergeFunctions Pass (PR #65963)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 21 23:27:42 PDT 2023
================
@@ -0,0 +1,22 @@
+;; Make sure internal constrained FP intrinsics still merge properly
+; RUN: opt -passes=mergefunc -S < %s | FileCheck %s
+; RUN: opt -passes=mergefunc -S < %s | FileCheck -check-prefix=MERGE %s
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+
+declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
+
+!round.dynamic = !{}
+!fpexcept.strict = !{}
+
+define internal float @func1(float %a, float %b) {
+; CHECK-LABEL: define internal float @func1(float %a, float %b)
+ %result = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ ret float %result
+}
+
+define internal float @func2(float %a, float %b) {
+; MERGE-NOT: define internal float @func2(float %a, float %b)
+ %result = call float @llvm.experimental.constrained.fadd.f32(float %a, float %b, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ ret float %result
+}
----------------
nikic wrote:
If you add an second call, then it should merge without internal as well, which is easier to test (with update_test_checks) because both functions will still be there.
https://github.com/llvm/llvm-project/pull/65963
More information about the llvm-commits
mailing list