[PATCH] D138490: [SelectOpt] Don't treat LogicalAnd/LogicalOr as selects

Sotiris Apostolakis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 14:04:36 PST 2022


apostolakis added a comment.

This looks fine to me as well and it is okay performance-wise (within noise margins for some testing I did).
My only suggestion is to separate this check in a separate function. See inline comment.



================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:528
+      // be better treated as an and/or.
+      if (match(SI, m_CombineOr(m_LogicalAnd(m_Value(), m_Value()),
+                                m_LogicalOr(m_Value(), m_Value()))))
----------------
I would suggest moving the added check to a new static function maybe called isSpecialSelect and continue if it returns true. It will make the code cleaner and maybe we will add more special select cases that should not be changed to branches. 


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

https://reviews.llvm.org/D138490



More information about the llvm-commits mailing list