[PATCH] D124183: [InstCombine] Add one use limitation for (X * C2) << C1 --> X * (C2 << C1)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 12:58:53 PDT 2022


spatel added a comment.

In D124183#3465419 <https://reviews.llvm.org/D124183#3465419>, @bcl5980 wrote:

> Thanks for the detail explaination. Is that means our general rule is don't add one-use first, but if there are some perf regressions happened then we add it ?

The general rule is to make the canonicalization with as few restrictions as possible, so avoid one-use checks if possible. But if we know or suspect that there can be regressions, we try to fix those by creating other (inverse) transforms in the backend for example.
But it is fine to be more conservative (add one-use) in an initial patch, remove it as an enhancement, and see if there are problems. With smaller changes to the compiler, it is generally easier to analyze the resulting performance changes in applications.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124183/new/

https://reviews.llvm.org/D124183



More information about the llvm-commits mailing list