[PATCH] D100211: [InstCombine] Fold cmpeq/ne(and(~X,Y),0) --> cmpeq/ne(or(freeze(X),Y),freeze(X)) (PR44136)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 11 11:07:22 PDT 2021


nikic added a comment.

In D100211#2681777 <https://reviews.llvm.org/D100211#2681777>, @RKSimon wrote:

> The missing middle-end fold was noted on the ticket (PR44136) - this patch is to show what would be necessary.
>
> Limiting this to isGuaranteedNotToBeUndefOrPoison would be safer, although I'm not sure how common the case is tbh. Happy to abandon and close the ticket if this is pointless extra work.

Using isGuaranteedNotTobeUndefOrPoison() will just make the transform apply inconsistently. It seems to me like there is little motivation for doing this change (the report was about the reverse transform in the backend after all), so I'd drop the patch for now. Can be reconsidered when undef goes away or we establish policy to ignore undef optimization bugs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100211



More information about the llvm-commits mailing list