[all-commits] [llvm/llvm-project] 46db90: [SCEV] `MatchBinaryOp()`: try to recognize `or` as...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Tue Dec 6 09:27:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 46db90cc71d11df1dd7d397d253445671836dfa0
      https://github.com/llvm/llvm-project/commit/46db90cc71d11df1dd7d397d253445671836dfa0
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Transforms/IndVarSimplify/pr58702-invalidate-scev-when-replacing-congruent-phis.ll

  Log Message:
  -----------
  [SCEV] `MatchBinaryOp()`: try to recognize `or` as `add`-in-disguise (w/ no common bits set)

LLVM *loves* to convert `add` of operands with no common bits
into an `or`. But SCEV really doesn't deal with `or` that well,
so try extra hard to recognize this `or` as an `add`.

I believe, previously this wasn't being done because of the recursive
of this, but now that the `createSCEV()` is not recursive,
this should be fine. Unless this is *too* costly compile-time wise...

https://alive2.llvm.org/ce/z/EfapCo




More information about the All-commits mailing list