[PATCH] D145299: [InstCombine] Generate better code for std::bit_ceil

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 08:58:44 PDT 2023


kazu added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:3193
+      match(CtlzOp, m_Not(m_Value(X)))) {
+    // We'll stop following the def-use chain when we encounter X.
+  }
----------------
RKSimon wrote:
> empty clause?
I would like to find `X` here and leave it `nullptr` if no match occurs.  I don't have any actions when the `if` condition is true.  Should I say something like this?

```
  (void) match(CtlzOp, m_Add(m_Value(X), m_ConstantInt())) ||
      match(CtlzOp, m_Sub(m_ConstantInt(), m_Value(X))) ||
      match(CtlzOp, m_Not(m_Value(X)));
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145299



More information about the llvm-commits mailing list