[PATCH] D45867: [InstCombine] Unfold masked merge with constant mask

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 28 14:07:08 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D45867#1082082, @xbolva00 wrote:

> In https://reviews.llvm.org/D45867#1082081, @lebedev.ri wrote:
>
> > In https://reviews.llvm.org/D45867#1082079, @xbolva00 wrote:
> >
> > > Not related to this patch exactly but since you work in this area... maybe you can check this too?
> > >  https://godbolt.org/g/wksfqb
> >
> >
> > That particular example should be handled by dead code elimination pass i guess,
> >  because it is literally optimized down to `return 0;`,
> >  since it only reads global `uint32_t b;` once, and ultimately does nothing with that.
> >
> > But, i have zero clues how it should be done.
>
>
> It is interesting, since even if we dont use "b", just leave it as "uint32_t a = 5;", the code is not eliminated since optimizer may think it could be infinite loop (?) (cc @chandlerc , @spatel )


You probably want to move that to a bugzilla issue, as you have noted yourself, this is completely unrelated from the patch a hand.


Repository:
  rL LLVM

https://reviews.llvm.org/D45867





More information about the llvm-commits mailing list