[PATCH] D144777: [InstCombine] Fold signbit test of a pow2 or zero
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 24 23:02:30 PST 2023
goldstein.w.n added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1343
+ // icmp sgt (and (sub 0, X), X), -1 --> icmp ne (X, CI)
+ if (match(Op0, m_OneUse(m_And(m_Sub(m_Zero(), m_Value(X)), m_Deferred(X))))) {
+ Constant *CI = ConstantInt::get(
----------------
There are other power of 2 patterns. Maybe use `isKnownPowerOf2`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144777/new/
https://reviews.llvm.org/D144777
More information about the llvm-commits
mailing list