[PATCH] D115886: [CodeGen] remove creation of FP cast function attribute
Sanjay Patel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 19 08:58:17 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1965cc469539: [CodeGen] remove creation of FP cast function attribute (authored by spatel).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115886/new/
https://reviews.llvm.org/D115886
Files:
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/no-junk-ftrunc.c
Index: clang/test/CodeGen/no-junk-ftrunc.c
===================================================================
--- clang/test/CodeGen/no-junk-ftrunc.c
+++ clang/test/CodeGen/no-junk-ftrunc.c
@@ -1,11 +1,12 @@
// RUN: %clang_cc1 -S -fno-strict-float-cast-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=NOSTRICT
// When compiling with non-standard semantics, use intrinsics to inhibit the optimizer.
+// This used to require a function attribute, so we check that it is NOT here anymore.
// NOSTRICT-LABEL: main
// NOSTRICT: call i32 @llvm.fptosi.sat.i32.f64
// NOSTRICT: call i32 @llvm.fptoui.sat.i32.f64
-// NOSTRICT: attributes #0 = {{.*}}"strict-float-cast-overflow"="false"{{.*}}
+// NOSTRICT-NOT: strict-float-cast-overflow
// The workaround attribute is not applied by default.
Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -1831,11 +1831,6 @@
if (LangOpts.getFPExceptionMode() == LangOptions::FPE_Ignore)
FuncAttrs.addAttribute("no-trapping-math", "true");
- // Strict (compliant) code is the default, so only add this attribute to
- // indicate that we are trying to workaround a problem case.
- if (!CodeGenOpts.StrictFloatCastOverflow)
- FuncAttrs.addAttribute("strict-float-cast-overflow", "false");
-
// TODO: Are these all needed?
// unsafe/inf/nan/nsz are handled by instruction-level FastMathFlags.
if (LangOpts.NoHonorInfs)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115886.395341.patch
Type: text/x-patch
Size: 1534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211219/4862a3d9/attachment-0001.bin>
More information about the cfe-commits
mailing list