[all-commits] [llvm/llvm-project] 06f3ef: [ConstraintElimination] Allow adding pre-condition...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Feb 4 03:45:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06f3ef66266f9a266c9979ef7686d085ac2a4df8
      https://github.com/llvm/llvm-project/commit/06f3ef66266f9a266c9979ef7686d085ac2a4df8
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-02-04 (Fri, 04 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
    M llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll
    M llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
    M llvm/test/Transforms/ConstraintElimination/large-system-growth.ll
    M llvm/test/Transforms/ConstraintElimination/loops-bottom-tested-pointer-cmps.ll
    M llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll

  Log Message:
  -----------
  [ConstraintElimination] Allow adding pre-conditions for constraints.

With this patch pre-conditions can be added to a list of constraints.
Constraints with pre-conditions can only be used if all pre-conditions
are satisfied when the constraint is used.

The pre-conditions at the moment are specified as a list of
(Predicate, Value *,Value *) tuples. This allow easily checking them
like any other condition, using the existing infrastructure.

This then is used to limit GEP decomposition to cases where we can
prove that offsets are signed positive.

This fixes a couple of incorrect transforms where GEP offsets where
assumed to be signed positive, but they were not.

Note that this effectively disables GEP decomposition, as there's no
support for reasoning about signed predicates. D118806 adds initial
signed support.

Fixes PR49624.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D118799




More information about the All-commits mailing list