[all-commits] [llvm/llvm-project] 1f1f03: [ConstraintElimination] Improve index handing duri...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Feb 8 05:07:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f1f037ed3101d3074f65faceca81218c88a505c
      https://github.com/llvm/llvm-project/commit/1f1f037ed3101d3074f65faceca81218c88a505c
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
    M llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll
    M llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll

  Log Message:
  -----------
  [ConstraintElimination] Improve index handing during constraint building.

This patch improves the index management during constraint building.
Previously, the code rejected constraints which used values that were not
part of Value2Index, but after combining the coefficients of the new
indices were 0 (if ShouldAdd was 0).

In those cases, no new indices need to be added. Instead of adding to
Value2Index directly, add new indices to the NewIndices map. The caller
can then check if it needs to add any new indices.

This enables checking constraints like `a + x <= a + n` to `x <= n`,
even if there is no constraint for `a` directly.




More information about the All-commits mailing list