[PATCH] D97637: [DAGCombiner][X86] Don't peek through ANDs on the shift amount in matchRotateSub when called from MatchFunnelPosNeg.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 28 11:30:27 PST 2021


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.
Herald added subscribers: ecnelises, pengfei, hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

Peeking through AND is only valid if the input to both shifts is
the same. If the inputs are different, then the original pattern
ORs the two values when the masked shift amount is 0. This is ok
if the values are the same since the OR would be a NOP which is
why its ok for rotate.

Fixes PR49365 and reverts PR34641


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97637

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/shift-double.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97637.326988.patch
Type: text/x-patch
Size: 4722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210228/70b7a7a5/attachment.bin>


More information about the llvm-commits mailing list