[PATCH] D140851: [Patch 3/4]: Add cases for assume (X & Y != {0|Y})
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 09:35:58 PST 2023
nikic added a reviewer: spatel.
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:939
+ // 1. is_pow2(b) && b == a
+ // v.zeros[log2(b)] = 1
+ // 2. is_pow2(b) && 0 == a
----------------
goldstein.w.n wrote:
> nikic wrote:
> > It looks like we are missing this canonicalization: https://alive2.llvm.org/ce/z/MtveLU With that done, this becomes `v & b == 0` and is covered by existing handling.
> > It looks like we are missing this canonicalization: https://alive2.llvm.org/ce/z/MtveLU With that done, this becomes `v & b == 0` and is covered by existing handling.
>
> So would a better approach be to handle the `v & b != a` canonicalization in `InstCombine` and drop this case or leave this as is?
Handling this in InstCombine would be preferred, it reduces the number of patterns other passes see.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140851/new/
https://reviews.llvm.org/D140851
More information about the llvm-commits
mailing list