[PATCH] D144248: [InstCombine] canonicalize urem as cmp+select (part 2)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 00:59:23 PST 2023


nikic added a comment.

I see. It looks like this much is safe to do without causing any regressions: https://github.com/nikic/llvm-project/commit/37366dc6bc6d168f081510a603982802a6964221 The ones in simplifyBinaryIntrinsic() and foldICmpWithDominatingICmp() are completely redundant.

The one in simplifySelectInst() is not redundant, because it uses a different context instruction: We would miss cases where we have `br i1 %c` followed by `select i1 %c`, because the comparison is not in the same block as the select. This is unfortunate...


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

https://reviews.llvm.org/D144248



More information about the llvm-commits mailing list