[PATCH] D153963: [InstCombine] Fold add of select and cast of select condition

Antonio Frighetto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 06:10:28 PDT 2023


antoniofrighetto added a comment.

Added proofs, added further tests, reviewed doc-comment, and added support for `uitofp`/`sitofp` conversion as well.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:1496
+                          m_ImmConstant(FalseC)))) {
+    if (CondVal == A) {
+      if (isa<ZExtInst>(RHS))
----------------
nikic wrote:
> In this case, we don't have to require that False is a constant, right?
Correct. This is not true when handling floating point though, for which it is required that both are constants. 


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

https://reviews.llvm.org/D153963



More information about the llvm-commits mailing list