[PATCH] D108408: [InstCombine] Transform X == 0 ? 0 : X * Y --> X * freeze(Y).

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 12:07:43 PDT 2021


spatel accepted this revision.
spatel added a comment.

LGTM, but let's wait at least a day to commit in case there are any other comments or suggestions.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:754
+  // Check that TrueVal is a constant instead of matching it with m_Zero()
+  // to handle the case when it is a scalar undef value.
+  auto *TrueValC = dyn_cast<Constant>(TrueVal);
----------------
Should that be something like:
"...when it is a scalar undef value or a vector containing non-zero elements that are masked by undef elements in the compare constant."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108408



More information about the llvm-commits mailing list