[PATCH] D78935: [DAGCombine] Move the remaining X86 funnel shift patterns to DAGCombine

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 09:06:38 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: spatel, craig.topper, deadalnix, xbolva00.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

X86 matches several 'shift+xor' funnel shift patterns:

  fold (or (srl (srl x1, 1), (xor y, 31)), (shl x0, y))  -> (fshl x0, x1, y)
  fold (or (shl (shl x0, 1), (xor y, 31)), (srl x1, y))  -> (fshr x0, x1, y)
  fold (or (shl (add x0, x0), (xor y, 31)), (srl x1, y)) -> (fshr x0, x1, y)


These patterns are also what we end up with the proposed expansion changes in D77301 <https://reviews.llvm.org/D77301>.

This patch moves these to DAGCombine's generic MatchFunnelPosNeg.

All existing X86 test cases still pass, and we just have a small codegen change in pr32282.ll.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78935

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/pr32282.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78935.260338.patch
Type: text/x-patch
Size: 8864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/8bdbf40d/attachment.bin>


More information about the llvm-commits mailing list