[llvm] 1689c35 - [ConstraintElim] Allow and check preconditions in doesHold.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 29 01:18:05 PDT 2023
Author: Florian Hahn
Date: 2023-06-29T09:17:37+01:00
New Revision: 1689c357ae8059d238f28f587047e7f010910d6e
URL: https://github.com/llvm/llvm-project/commit/1689c357ae8059d238f28f587047e7f010910d6e
DIFF: https://github.com/llvm/llvm-project/commit/1689c357ae8059d238f28f587047e7f010910d6e.diff
LOG: [ConstraintElim] Allow and check preconditions in doesHold.
Delegate checking of the constraint & its preconditions to the existing
::isValid. This reduces duplication and allows additional optimizations
together with D152730.
Added:
Modified:
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index afa554c62d2b00..864f0a1326cee9 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -693,7 +693,7 @@ ConstraintTy::isImpliedBy(const ConstraintSystem &CS) const {
bool ConstraintInfo::doesHold(CmpInst::Predicate Pred, Value *A,
Value *B) const {
auto R = getConstraintForSolving(Pred, A, B);
- return R.Preconditions.empty() && !R.empty() &&
+ return R.isValid(*this) &&
getCS(R.IsSigned).isConditionImplied(R.Coefficients);
}
More information about the llvm-commits
mailing list