Skip to content

Commit 1965cc4

Browse files
committed
[CodeGen] remove creation of FP cast function attribute
This is the last cleanup step resulting from D115804 . Now that clang uses intrinsics when we're in the special FP mode, we don't need a function attribute as an indicator to the backend. The LLVM part of the change is in D115885. Differential Revision: https://reviews.llvm.org/D115886
1 parent 5bb21ce commit 1965cc4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,11 +1831,6 @@ void CodeGenModule::getDefaultFunctionAttributes(StringRef Name,
18311831
if (LangOpts.getFPExceptionMode() == LangOptions::FPE_Ignore)
18321832
FuncAttrs.addAttribute("no-trapping-math", "true");
18331833

1834-
// Strict (compliant) code is the default, so only add this attribute to
1835-
// indicate that we are trying to workaround a problem case.
1836-
if (!CodeGenOpts.StrictFloatCastOverflow)
1837-
FuncAttrs.addAttribute("strict-float-cast-overflow", "false");
1838-
18391834
// TODO: Are these all needed?
18401835
// unsafe/inf/nan/nsz are handled by instruction-level FastMathFlags.
18411836
if (LangOpts.NoHonorInfs)

clang/test/CodeGen/no-junk-ftrunc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// RUN: %clang_cc1 -S -fno-strict-float-cast-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=NOSTRICT
22

33
// When compiling with non-standard semantics, use intrinsics to inhibit the optimizer.
4+
// This used to require a function attribute, so we check that it is NOT here anymore.
45

56
// NOSTRICT-LABEL: main
67
// NOSTRICT: call i32 @llvm.fptosi.sat.i32.f64
78
// NOSTRICT: call i32 @llvm.fptoui.sat.i32.f64
8-
// NOSTRICT: attributes #0 = {{.*}}"strict-float-cast-overflow"="false"{{.*}}
9+
// NOSTRICT-NOT: strict-float-cast-overflow
910

1011
// The workaround attribute is not applied by default.
1112

0 commit comments

Comments
 (0)