Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Fricke <spencerfricke@gmail.com>2022-09-23 21:02:01 +0300
committerGitHub <noreply@github.com>2022-09-23 21:02:01 +0300
commit49230a2307a53a99ad699f729b6a2cc8850f754c (patch)
treef3b288f700ab731fe2fb2861ed58d1dd68be51b5
parentb53d7a8affabb230a47fb4123b040573a3062d4a (diff)
spirv-opt: Remove unused folding rule (#4942)
-rw-r--r--source/opt/const_folding_rules.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/source/opt/const_folding_rules.cpp b/source/opt/const_folding_rules.cpp
index cb3608747..0ad755c94 100644
--- a/source/opt/const_folding_rules.cpp
+++ b/source/opt/const_folding_rules.cpp
@@ -74,7 +74,7 @@ bool HasFloatingPoint(const analysis::Type* type) {
// Returns a constants with the value |-val| of the given type. Only works for
// 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs.
-const analysis::Constant* negateFPConst(const analysis::Type* result_type,
+const analysis::Constant* NegateFPConst(const analysis::Type* result_type,
const analysis::Constant* val,
analysis::ConstantManager* const_mgr) {
const analysis::Float* float_type = result_type->AsFloat();
@@ -755,7 +755,7 @@ const analysis::Constant* FoldFPScalarDivideByZero(
}
if (numerator->AsFloatConstant()->GetValueAsDouble() < 0.0) {
- result = negateFPConst(result_type, result, const_mgr);
+ result = NegateFPConst(result_type, result, const_mgr);
}
return result;
}
@@ -780,7 +780,7 @@ const analysis::Constant* FoldScalarFPDivide(
const analysis::Constant* result =
FoldFPScalarDivideByZero(result_type, numerator, const_mgr);
if (result != nullptr)
- result = negateFPConst(result_type, result, const_mgr);
+ result = NegateFPConst(result_type, result, const_mgr);
return result;
} else {
return FOLD_FPARITH_OP(/)(result_type, numerator, denominator, const_mgr);
@@ -951,7 +951,7 @@ UnaryScalarFoldingRule FoldFNegateOp() {
analysis::ConstantManager* const_mgr) -> const analysis::Constant* {
assert(result_type != nullptr && a != nullptr);
assert(result_type == a->type());
- return negateFPConst(result_type, a, const_mgr);
+ return NegateFPConst(result_type, a, const_mgr);
};
}
@@ -1183,17 +1183,6 @@ ConstantFoldingRule FoldFMix() {
};
}
-template <class IntType>
-IntType FoldIClamp(IntType x, IntType min_val, IntType max_val) {
- if (x < min_val) {
- x = min_val;
- }
- if (x > max_val) {
- x = max_val;
- }
- return x;
-}
-
const analysis::Constant* FoldMin(const analysis::Type* result_type,
const analysis::Constant* a,
const analysis::Constant* b,