[all-commits] [llvm/llvm-project] a0d194: [IndVars] Add test cases inspired by PR48965.

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Feb 20 08:25:47 PST 2021


  Branch: refs/heads/perf/tmp
  Home:   https://github.com/llvm/llvm-project
  Commit: a0d1941ff08d2e460c653ea948fbd88d7ad2620b
      https://github.com/llvm/llvm-project/commit/a0d1941ff08d2e460c653ea948fbd88d7ad2620b
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-02-20 (Sat, 20 Feb 2021)

  Changed paths:
    A llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll

  Log Message:
  -----------
  [IndVars] Add test cases inspired by PR48965.


  Commit: be3a066ebfe86371a159267e1c7287a86614e041
      https://github.com/llvm/llvm-project/commit/be3a066ebfe86371a159267e1c7287a86614e041
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-02-20 (Sat, 20 Feb 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
    M llvm/test/Transforms/IndVarSimplify/simplify-pointer-arithmetic.ll

  Log Message:
  -----------
  [SCEV] Improve handling of pointer compares involving subtractions.

This patch improves handling of pointer comparisons involving
subtractions, by using knowledge that the involved variables are != 0
and signed positive.

It uses applyLoopGuards to add != 0 info to the involved expressions (by
re-writing them as umax expression. It also adds a new fold to move zext
into umax expressions and to move udiv expression inside subtraction, if
the operands guarantee a positive result.

Proof for zext/umax fold: https://alive2.llvm.org/ce/z/t75T53

Proof for getUDivExpr extension:a https://alive2.llvm.org/ce/z/H_G2Q0

Proof for isKnownPredicateSubIdiom: https://alive2.llvm.org/ce/z/Gfe8mS


Compare: https://github.com/llvm/llvm-project/compare/ac5cc50e2598...be3a066ebfe8


More information about the All-commits mailing list