[all-commits] [llvm/llvm-project] 58ebc7: [InstCombine] Strip offset when folding and/or of ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Nov 10 13:02:09 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58ebc79a64a5ca8dacf504f55d904e030effa164
      https://github.com/llvm/llvm-project/commit/58ebc79a64a5ca8dacf504f55d904e030effa164
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-11-10 (Wed, 10 Nov 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/and-or-icmps.ll
    M llvm/test/Transforms/InstCombine/or.ll
    M llvm/test/Transforms/InstCombine/signed-truncation-check.ll

  Log Message:
  -----------
  [InstCombine] Strip offset when folding and/or of icmps

When folding and/or of icmps, look through add of a constant and
adjust the icmp range instead. Effectively, this decomposes
X + C1 < C2 style range checks back into a normal range. This allows
us to fold comparisons involving two range checks or one range check
and some other condition. We had a fold for a really specific case
of this (or of range check and eq, and only one one side!) while
this handles it in fully generality.

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




More information about the All-commits mailing list