aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstraintSystem.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-01-12[llvm] Remove redundant string initialization (NFC)Kazu Hirata1-1/+1
Identified with readability-redundant-string-init.
2020-12-06[ConstraintElimination] Bail out if system gets too big.Florian Hahn1-0/+3
For some inputs, the constraint system can grow quite large during solving, because it replaces complex constraints with one or more simpler constraints. This adds a cut-off to avoid compile-time explosion on problematic inputs.
2020-12-05[ConstraintElimination] Wrap dump() call in LLVM_DEBUG (NFC).Florian Hahn1-1/+1
ConstraintSystem::dump only generates output with -debug, but there's no need to call it without -debug.
2020-12-05[ConstraintElimination] Handle constraints with all zero var coeffs.Florian Hahn1-0/+5
Constraints where all variable coefficients are 0 do not add any useful information. When checking, we can check if they are always true/false.
2020-09-17[ConstraintSystem] Remove local variable that is set but not read [NFC]Mikael Holmen1-2/+0
gcc 7.4 warns about it.
2020-09-15[ConstraintSolver] Add isConditionImplied helper.Florian Hahn1-0/+10
This patch adds a isConditionImplied function that takes a constraint and returns true if the constraint is implied by the current constraints in the system. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D84545
2020-09-15Recommit "[ConstraintSystem] Add helpers to deal with linear constraints."Florian Hahn1-0/+142
This patch recommits "[ConstraintSystem] Add helpers to deal with linear constraints." (it reverts the revert commit 8da6ae4ce1b686c5c13698e4c5ee937811fda6f7). The reason for the revert was using __builtin_multiply_overflow, which is not available for all compilers. The patch has been updated to use MulOverflow from MathExtras.h
2020-09-11Revert "[ConstraintSystem] Add helpers to deal with linear constraints."Florian Hahn1-141/+0
This reverts commit 3eb141e5078a0ce9d92eadc721bc49d214d23056. This uses __builtin_mul_overflow which is not available everywhere.
2020-09-11[ConstraintSystem] Add helpers to deal with linear constraints.Florian Hahn1-0/+141
This patch introduces a new ConstraintSystem class, that maintains a set of linear constraints and uses Fourier–Motzkin elimination to eliminate constraints to check if there are solutions for the system. It also adds a convert-constraint-log-to-z3.py script, which can parse the debug output of the constraint system and convert it to a python script that feeds the constraints into Z3 and checks if it produces the same result as the LLVM implementation. This is for verification purposes. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D84544