[all-commits] [llvm/llvm-project] c6e136: [PredicateInfo] Add a method to interpret predicat...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun Jul 19 06:34:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c6e13667e787b3a72b794422ab506d5403ddcd21
      https://github.com/llvm/llvm-project/commit/c6e13667e787b3a72b794422ab506d5403ddcd21
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-07-19 (Sun, 19 Jul 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/PredicateInfo.h
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/lib/Transforms/Utils/PredicateInfo.cpp
    M llvm/test/Transforms/SCCP/predicateinfo-cond.ll

  Log Message:
  -----------
  [PredicateInfo] Add a method to interpret predicate as cmp constraint

Both users of predicteinfo (NewGVN and SCCP) are interested in
getting a cmp constraint on the predicated value. They currently
implement separate logic for this. This patch adds a common method
for this in PredicateBase.

This enables a missing bit of PredicateInfo handling in SCCP: Now
the predicate on the condition itself is also used. For switches
it means we know that the switched-on value is the same as the case
value. For assumes/branches we know that the condition is true or
false.

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




More information about the All-commits mailing list