[PATCH] D152116: [X86] Transform `(icmp eq/ne (and X, C0), (shift X, C1))` to get better constants.
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 6 10:28:29 PDT 2023
goldstein.w.n added a comment.
In D152116#4399143 <https://reviews.llvm.org/D152116#4399143>, @RKSimon wrote:
> This looks similar to optimizeSetCCByHoistingAndByConstFromLogicalShift/shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd - can we extend that and perform this as a generic combine?
Didn't see those earlier.
So `optimizeSetCCByHoistingAndByConstFromLogicalShift` seems meaningfully different. Just very different node pattern for `X & (C shift Y) eq/ne 0` vs `(X shift C0) eq/ne (X and C1)`. Then likewise `shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd` seems built for `optimizeSetCCByHoistingAndByConstFromLogicalShift`.
I see the similarity and think could probably could implement both in ``optimizeSetCCByHoistingAndByConstFromLogicalShift` but think it would end up pretty awkward.
WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152116/new/
https://reviews.llvm.org/D152116
More information about the llvm-commits
mailing list