[PATCH] D70462: [InstCombine] Change InstCombineAddSub to not perform constant folding when there is an intermediate use of the source register.

Danilo Carvalho Grael via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 12:05:41 PST 2019


dancgr added a comment.

In D70462#1752506 <https://reviews.llvm.org/D70462#1752506>, @lebedev.ri wrote:

> -1 to adding more artificial one-use restrictions.
>  I agree there is a general problem of unability to see if
>  there exists a particular instruction already.


I'm wondering why we should avoid one-use restrictions. Is there any discussion that I'm not aware of?

In this case, we only want to apply the folding if there is only one use of first expression. If there is any more than that, the folding won't give any improvement or cause issues with other optimizations. How would you suggest that I avoid this issue without checking for one-use?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70462





More information about the llvm-commits mailing list