[all-commits] [llvm/llvm-project] 0ad687: [ConstraintElim] Try to use first cmp to prove sec...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Wed Jun 28 05:21:56 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0ad6879a626edc2947b4a513e1473febb47e8072
https://github.com/llvm/llvm-project/commit/0ad6879a626edc2947b4a513e1473febb47e8072
Author: Florian Hahn <flo at fhahn.com>
Date: 2023-06-28 (Wed, 28 Jun 2023)
Changed paths:
M llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
M llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
M llvm/test/Transforms/ConstraintElimination/and.ll
M llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll
M llvm/test/Transforms/ConstraintElimination/geps-precondition-overflow-check.ll
Log Message:
-----------
[ConstraintElim] Try to use first cmp to prove second cmp for ANDs.
This patch extends the existing logic to handle cases where we have
branch conditions of the form (AND icmp, icmp) where the first icmp
implies the second. This can improve results in some cases, e.g. if
SimplifyCFG folded conditions from multiple branches to an AND.
The implementation handles this by adding a new type of check
(AndImpliedCheck), which are queued before conditional facts for the same
block.
When encountering AndImpliedChecks during solving, the first condition
is optimistically added to the constraint system, then we check if the
second icmp can be simplified, and finally the newly added entries are
removed.
The reason for doing things this way is to avoid clashes with signed
<-> unsigned condition transfer, which require us to re-order facts to
increase effectiveness.
Reviewed By: nikic, antoniofrighetto
Differential Revision: https://reviews.llvm.org/D151799
More information about the All-commits
mailing list