Skip to content

Commit ac4271a

Browse files
committed
Rename fpe.* to fp.*
1 parent c41809e commit ac4271a

17 files changed

+361
-362
lines changed

clang/test/CodeGen/strictfp_builtins.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ void p(char *str, int x) {
3131
// CHECK-NEXT: [[D_ADDR:%.*]] = alloca double, align 8
3232
// CHECK-NEXT: store double [[D:%.*]], ptr [[D_ADDR]], align 8
3333
// CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[D_ADDR]], align 8
34-
// CHECK-NEXT: [[ISZERO:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP0]], double 0.000000e+00, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5:[0-9]+]] [ "fpe.except"(metadata !"strict") ]
34+
// CHECK-NEXT: [[ISZERO:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP0]], double 0.000000e+00, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5:[0-9]+]] [ "fp.except"(metadata !"strict") ]
3535
// CHECK-NEXT: br i1 [[ISZERO]], label [[FPCLASSIFY_END:%.*]], label [[FPCLASSIFY_NOT_ZERO:%.*]]
3636
// CHECK: fpclassify_end:
3737
// CHECK-NEXT: [[FPCLASSIFY_RESULT:%.*]] = phi i32 [ 4, [[ENTRY:%.*]] ], [ 0, [[FPCLASSIFY_NOT_ZERO]] ], [ 1, [[FPCLASSIFY_NOT_NAN:%.*]] ], [ [[TMP2:%.*]], [[FPCLASSIFY_NOT_INF:%.*]] ]
3838
// CHECK-NEXT: call void @p(ptr noundef @.str.1, i32 noundef [[FPCLASSIFY_RESULT]]) #[[ATTR4]]
3939
// CHECK-NEXT: ret void
4040
// CHECK: fpclassify_not_zero:
41-
// CHECK-NEXT: [[CMP:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP0]], double [[TMP0]], metadata !"uno", metadata !"fpexcept.strict") #[[ATTR5]] [ "fpe.except"(metadata !"strict") ]
41+
// CHECK-NEXT: [[CMP:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP0]], double [[TMP0]], metadata !"uno", metadata !"fpexcept.strict") #[[ATTR5]] [ "fp.except"(metadata !"strict") ]
4242
// CHECK-NEXT: br i1 [[CMP]], label [[FPCLASSIFY_END]], label [[FPCLASSIFY_NOT_NAN]]
4343
// CHECK: fpclassify_not_nan:
4444
// CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.fabs.f64(double [[TMP0]]) #[[ATTR6:[0-9]+]]
45-
// CHECK-NEXT: [[ISINF:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x7FF0000000000000, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5]] [ "fpe.except"(metadata !"strict") ]
45+
// CHECK-NEXT: [[ISINF:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x7FF0000000000000, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5]] [ "fp.except"(metadata !"strict") ]
4646
// CHECK-NEXT: br i1 [[ISINF]], label [[FPCLASSIFY_END]], label [[FPCLASSIFY_NOT_INF]]
4747
// CHECK: fpclassify_not_inf:
48-
// CHECK-NEXT: [[ISNORMAL:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x10000000000000, metadata !"uge", metadata !"fpexcept.strict") #[[ATTR5]] [ "fpe.except"(metadata !"strict") ]
48+
// CHECK-NEXT: [[ISNORMAL:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x10000000000000, metadata !"uge", metadata !"fpexcept.strict") #[[ATTR5]] [ "fp.except"(metadata !"strict") ]
4949
// CHECK-NEXT: [[TMP2]] = select i1 [[ISNORMAL]], i32 2, i32 3
5050
// CHECK-NEXT: br label [[FPCLASSIFY_END]]
5151
//
@@ -157,7 +157,7 @@ void test_double_isfinite(double d) {
157157
// CHECK-NEXT: store double [[D:%.*]], ptr [[D_ADDR]], align 8
158158
// CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[D_ADDR]], align 8
159159
// CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.fabs.f64(double [[TMP0]]) #[[ATTR6]]
160-
// CHECK-NEXT: [[ISINF:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x7FF0000000000000, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5]] [ "fpe.except"(metadata !"strict") ]
160+
// CHECK-NEXT: [[ISINF:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double 0x7FF0000000000000, metadata !"oeq", metadata !"fpexcept.strict") #[[ATTR5]] [ "fp.except"(metadata !"strict") ]
161161
// CHECK-NEXT: [[TMP2:%.*]] = bitcast double [[TMP0]] to i64
162162
// CHECK-NEXT: [[TMP3:%.*]] = icmp slt i64 [[TMP2]], 0
163163
// CHECK-NEXT: [[TMP4:%.*]] = select i1 [[TMP3]], i32 -1, i32 1

clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ kernel void device_side_enqueue(global float *a, global float *b, int i) {
144144
// STRICTFP-NEXT: [[TMP1:%.*]] = load i32, ptr addrspace(4) [[BLOCK_CAPTURE_ADDR1]], align 4
145145
// STRICTFP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds float, ptr addrspace(1) [[TMP0]], i32 [[TMP1]]
146146
// STRICTFP-NEXT: [[TMP2:%.*]] = load float, ptr addrspace(1) [[ARRAYIDX]], align 4
147-
// STRICTFP-NEXT: [[TMP3:%.*]] = call float @llvm.experimental.constrained.fmuladd.f32(float 4.000000e+00, float [[TMP2]], float 1.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.strict") #[[ATTR6:[0-9]+]] [ "fpe.control"(metadata !"rte"), "fpe.except"(metadata !"strict") ]
147+
// STRICTFP-NEXT: [[TMP3:%.*]] = call float @llvm.experimental.constrained.fmuladd.f32(float 4.000000e+00, float [[TMP2]], float 1.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.strict") #[[ATTR6:[0-9]+]] [ "fp.control"(metadata !"rte"), "fp.except"(metadata !"strict") ]
148148
// STRICTFP-NEXT: [[BLOCK_CAPTURE_ADDR2:%.*]] = getelementptr inbounds nuw <{ i32, i32, ptr addrspace(4), ptr addrspace(1), i32, ptr addrspace(1) }>, ptr addrspace(4) [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 3
149149
// STRICTFP-NEXT: [[TMP4:%.*]] = load ptr addrspace(1), ptr addrspace(4) [[BLOCK_CAPTURE_ADDR2]], align 4
150150
// STRICTFP-NEXT: [[BLOCK_CAPTURE_ADDR3:%.*]] = getelementptr inbounds nuw <{ i32, i32, ptr addrspace(4), ptr addrspace(1), i32, ptr addrspace(1) }>, ptr addrspace(4) [[DOTBLOCK_DESCRIPTOR]], i32 0, i32 4

llvm/docs/LangRef.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,7 @@ depend on floating-point options, such as rounding mode, denormal modes, etc.
30683068
There are two kinds of such operand bundles, which represent the value of
30693069
floating-point control modes and the treatment of status bits respectively.
30703070

3071-
An operand bundle tagged with "fpe.control" contains information about the
3071+
An operand bundle tagged with "fp.control" contains information about the
30723072
control modes used for the operation execution. Currently, only rounding mode is
30733073
supported. It is represented by a metadata string value, which specifies the
30743074
rounding mode to be used for the operation evaluation. Possible values are:
@@ -3082,12 +3082,12 @@ rounding mode to be used for the operation evaluation. Possible values are:
30823082
"rmm" - to nearest, ties away from zero
30833083
"dyn" - rounding mode is taken from control register
30843084

3085-
If "fpe.control" is absent, the default rounding rounding mode is taken from the
3085+
If "fp.control" is absent, the default rounding rounding mode is taken from the
30863086
control register (dynamic rounding). In the particular case of
30873087
:ref:`default floating-point environment <floatenv>`, it must be rounding to
30883088
nearest, ties to even.
30893089

3090-
An operand bundle tagged with "fpe.except" may be associated with operations
3090+
An operand bundle tagged with "fp.except" may be associated with operations
30913091
that can read or write floating-point exception flags. It contains a single
30923092
metadata string value, which can have one of the following values:
30933093

llvm/include/llvm/IR/LLVMContext.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class LLVMContext {
9696
OB_ptrauth = 7, // "ptrauth"
9797
OB_kcfi = 8, // "kcfi"
9898
OB_convergencectrl = 9, // "convergencectrl"
99-
OB_fpe_control = 10, // "fpe.control"
100-
OB_fpe_except = 11, // "fpe.except"
99+
OB_fp_control = 10, // "fp.control"
100+
OB_fp_except = 11, // "fp.except"
101101
};
102102

103103
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.

llvm/lib/AsmParser/LLParser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6430,7 +6430,7 @@ void LLParser::updateConstrainedIntrinsic(
64306430
return;
64316431

64326432
for (auto &B : Bundles) {
6433-
if (B.getTag().starts_with("fpe."))
6433+
if (B.getTag().starts_with("fp."))
64346434
return;
64356435
}
64366436

llvm/lib/IR/IRBuilder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ CallInst *IRBuilderBase::CreateCall(FunctionType *FTy, Value *Callee,
102102
bool NeedRound = true, NeedExcept = true;
103103
doesCallAccessFPEnv = true;
104104
for (const auto &Item : OpBundles) {
105-
if (NeedRound && Item.getTag() == "fpe.control")
105+
if (NeedRound && Item.getTag() == "fp.control")
106106
NeedRound = false;
107-
else if (NeedExcept && Item.getTag() == "fpe.except")
107+
else if (NeedExcept && Item.getTag() == "fp.except")
108108
NeedExcept = false;
109109
ActualBundles.push_back(Item);
110110
}

llvm/lib/IR/Instructions.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ bool CallBase::hasClobberingOperandBundles() const {
622622
}
623623

624624
std::optional<RoundingMode> CallBase::getRoundingMode() const {
625-
if (auto RoundingBundle = getOperandBundle(LLVMContext::OB_fpe_control)) {
625+
if (auto RoundingBundle = getOperandBundle(LLVMContext::OB_fp_control)) {
626626
Value *V = RoundingBundle->Inputs.front();
627627
Metadata *MD = cast<MetadataAsValue>(V)->getMetadata();
628628
return convertStrToRoundingMode(cast<MDString>(MD)->getString(), true);
@@ -631,7 +631,7 @@ std::optional<RoundingMode> CallBase::getRoundingMode() const {
631631
}
632632

633633
std::optional<fp::ExceptionBehavior> CallBase::getExceptionBehavior() const {
634-
if (auto ExceptionBundle = getOperandBundle(LLVMContext::OB_fpe_except)) {
634+
if (auto ExceptionBundle = getOperandBundle(LLVMContext::OB_fp_except)) {
635635
Value *V = ExceptionBundle->Inputs.front();
636636
Metadata *MD = cast<MetadataAsValue>(V)->getMetadata();
637637
return convertStrToExceptionBehavior(cast<MDString>(MD)->getString(), true);
@@ -640,8 +640,8 @@ std::optional<fp::ExceptionBehavior> CallBase::getExceptionBehavior() const {
640640
}
641641

642642
bool CallBase::hasFloatingPointBundles() const {
643-
return getOperandBundle(LLVMContext::OB_fpe_control) ||
644-
getOperandBundle(LLVMContext::OB_fpe_except);
643+
return getOperandBundle(LLVMContext::OB_fp_control) ||
644+
getOperandBundle(LLVMContext::OB_fp_except);
645645
}
646646

647647
MemoryEffects CallBase::getFloatingPointMemoryEffects() const {
@@ -767,7 +767,7 @@ void llvm::addFPRoundingBundle(LLVMContext &Ctx,
767767
assert(RndStr && "Garbage rounding mode!");
768768
auto *RoundingMDS = MDString::get(Ctx, *RndStr);
769769
auto *RM = MetadataAsValue::get(Ctx, RoundingMDS);
770-
Bundles.emplace_back("fpe.control", RM);
770+
Bundles.emplace_back("fp.control", RM);
771771
}
772772

773773
void llvm::addFPExceptionBundle(LLVMContext &Ctx,
@@ -777,7 +777,7 @@ void llvm::addFPExceptionBundle(LLVMContext &Ctx,
777777
assert(ExcStr && "Garbage exception behavior!");
778778
auto *ExceptMDS = MDString::get(Ctx, *ExcStr);
779779
auto *EB = MetadataAsValue::get(Ctx, ExceptMDS);
780-
Bundles.emplace_back("fpe.except", EB);
780+
Bundles.emplace_back("fp.except", EB);
781781
}
782782

783783
//===----------------------------------------------------------------------===//

llvm/lib/IR/LLVMContext.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
8282
assert(Entry->second == BundleTagID && "operand bundle id drifted!");
8383
}
8484

85-
auto *RoundingEntry = pImpl->getOrInsertBundleTag("fpe.control");
86-
assert(RoundingEntry->second == LLVMContext::OB_fpe_control &&
87-
"fpe.control operand bundle id drifted!");
85+
auto *RoundingEntry = pImpl->getOrInsertBundleTag("fp.control");
86+
assert(RoundingEntry->second == LLVMContext::OB_fp_control &&
87+
"fp.control operand bundle id drifted!");
8888
(void)RoundingEntry;
8989

90-
auto *ExceptionEntry = pImpl->getOrInsertBundleTag("fpe.except");
91-
assert(ExceptionEntry->second == LLVMContext::OB_fpe_except &&
92-
"fpe.except operand bundle id drifted!");
90+
auto *ExceptionEntry = pImpl->getOrInsertBundleTag("fp.except");
91+
assert(ExceptionEntry->second == LLVMContext::OB_fp_except &&
92+
"fp.except operand bundle id drifted!");
9393
(void)ExceptionEntry;
9494

9595
SyncScope::ID SingleThreadSSID =

llvm/lib/IR/Verifier.cpp

+16-17
Original file line numberDiff line numberDiff line change
@@ -3796,32 +3796,31 @@ void Verifier::visitCallBase(CallBase &Call) {
37963796
"Multiple \"clang.arc.attachedcall\" operand bundles", Call);
37973797
FoundAttachedCallBundle = true;
37983798
verifyAttachedCallBundle(Call, BU);
3799-
} else if (Tag == LLVMContext::OB_fpe_control) {
3800-
Check(!FoundFpeControlBundle, "Multiple fpe.control operand bundles",
3799+
} else if (Tag == LLVMContext::OB_fp_control) {
3800+
Check(!FoundFpeControlBundle, "Multiple fp.control operand bundles",
38013801
Call);
38023802
Check(BU.Inputs.size() == 1,
3803-
"Expected exactly one fpe.control bundle operand", Call);
3803+
"Expected exactly one fp.control bundle operand", Call);
38043804
auto *V = dyn_cast<MetadataAsValue>(BU.Inputs.front());
3805-
Check(V, "Value of fpe.control bundle operand must be a metadata", Call);
3805+
Check(V, "Value of fp.control bundle operand must be a metadata", Call);
38063806
auto *MDS = dyn_cast<MDString>(V->getMetadata());
3807-
Check(MDS, "Value of fpe.control bundle operand must be a string", Call);
3807+
Check(MDS, "Value of fp.control bundle operand must be a string", Call);
38083808
auto RM = convertStrToRoundingMode(MDS->getString(), true);
3809-
Check(
3810-
RM.has_value(),
3811-
"Value of fpe.control bundle operand is not a correct rounding mode",
3812-
Call);
3809+
Check(RM.has_value(),
3810+
"Value of fp.control bundle operand is not a correct rounding mode",
3811+
Call);
38133812
FoundFpeControlBundle = true;
3814-
} else if (Tag == LLVMContext::OB_fpe_except) {
3815-
Check(!FoundFpeExceptBundle, "Multiple fpe.except operand bundles", Call);
3813+
} else if (Tag == LLVMContext::OB_fp_except) {
3814+
Check(!FoundFpeExceptBundle, "Multiple fp.except operand bundles", Call);
38163815
Check(BU.Inputs.size() == 1,
3817-
"Expected exactly one fpe.except bundle operand", Call);
3816+
"Expected exactly one fp.except bundle operand", Call);
38183817
auto *V = dyn_cast<MetadataAsValue>(BU.Inputs.front());
3819-
Check(V, "Value of fpe.except bundle operand must be a metadata", Call);
3818+
Check(V, "Value of fp.except bundle operand must be a metadata", Call);
38203819
auto *MDS = dyn_cast<MDString>(V->getMetadata());
3821-
Check(MDS, "Value of fpe.except bundle operand must be a string", Call);
3820+
Check(MDS, "Value of fp.except bundle operand must be a string", Call);
38223821
auto EB = convertStrToExceptionBehavior(MDS->getString(), true);
38233822
Check(EB.has_value(),
3824-
"Value of fpe.except bundle operand is not a correct exception "
3823+
"Value of fp.except bundle operand is not a correct exception "
38253824
"behavior",
38263825
Call);
38273826
FoundFpeExceptBundle = true;
@@ -3867,7 +3866,7 @@ void Verifier::verifyConstrainedInstrinsicCall(const CallBase &CB) {
38673866
// operand bundles.
38683867
if (std::optional<RoundingMode> RM = getRoundingModeArg(CB)) {
38693868
RoundingMode Rounding = *RM;
3870-
auto RoundingBundle = CB.getOperandBundle(LLVMContext::OB_fpe_control);
3869+
auto RoundingBundle = CB.getOperandBundle(LLVMContext::OB_fp_control);
38713870
Check(RoundingBundle,
38723871
"Constrained intrinsic has a rounding argument but the call does not",
38733872
CB);
@@ -3885,7 +3884,7 @@ void Verifier::verifyConstrainedInstrinsicCall(const CallBase &CB) {
38853884

38863885
if (std::optional<fp::ExceptionBehavior> EB = getExceptionBehaviorArg(CB)) {
38873886
fp::ExceptionBehavior Excepts = *EB;
3888-
auto ExceptionBundle = CB.getOperandBundle(LLVMContext::OB_fpe_except);
3887+
auto ExceptionBundle = CB.getOperandBundle(LLVMContext::OB_fp_except);
38893888
Check(ExceptionBundle,
38903889
"Constrained intrinsic has an exception handling argument but the "
38913890
"call does not",

llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static bool markTails(Function &F, OptimizationRemarkEmitter *ORE) {
256256
LLVMContext::OB_kcfi,
257257
// A call with FP operand bundles should be treated in the same
258258
// way as a call without them.
259-
LLVMContext::OB_fpe_control, LLVMContext::OB_fpe_except});
259+
LLVMContext::OB_fp_control, LLVMContext::OB_fp_except});
260260

261261
if (!IsNoTail && CI->doesNotAccessMemory()) {
262262
// A call to a readnone function whose arguments are all things computed

0 commit comments

Comments
 (0)