Skip to content

Commit 2c43c27

Browse files
authored
Merge pull request #69828 from jkshtj/main
[sil-optimizer] Add FP comparison support in constant folder
2 parents e214ba5 + cc3c51e commit 2c43c27

File tree

6 files changed

+1531
-39
lines changed

6 files changed

+1531
-39
lines changed

include/swift/SILOptimizer/Utils/ConstantFolding.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ class SILOptFunctionBuilder;
3131
/// The \p ID must be the ID of a binary bit-operation builtin.
3232
APInt constantFoldBitOperation(APInt lhs, APInt rhs, BuiltinValueKind ID);
3333

34+
/// Evaluates the constant result of a floating point comparison.
35+
///
36+
/// The \p ID must be the ID of a floating point builtin operation.
37+
APInt constantFoldComparisonFloat(APFloat lhs, APFloat rhs,
38+
BuiltinValueKind ID);
39+
3440
/// Evaluates the constant result of an integer comparison.
3541
///
3642
/// The \p ID must be the ID of an integer builtin operation.
37-
APInt constantFoldComparison(APInt lhs, APInt rhs, BuiltinValueKind ID);
43+
APInt constantFoldComparisonInt(APInt lhs, APInt rhs, BuiltinValueKind ID);
3844

3945
/// Evaluates the constant result of a binary operation with overflow.
4046
///

0 commit comments

Comments
 (0)