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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 14:37:29 PST 2019


lebedev.ri added a comment.

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

> In D70462#1753932 <https://reviews.llvm.org/D70462#1753932>, @dancgr wrote:
>
> > How would you suggest that I avoid this issue without checking for one-use?
>
>
> I don't have a simple solution for the issue as described in the patch's description,
>  although i feel like noting that i believe i have seen similar cases myself.


Err, i mean, other than ensuring that the fold you are looking for happens before this constant-folding.
But a bit of a warning: such fold reordering pretty much always exposes other missed folds that will need to be added first.


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