[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
Wed Apr 29 14:33:40 PDT 2020


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6387
+
+    // fold (or (shl (add x0, x0), (xor y, 31)), (srl x1, y))
+    //   -> (fshr x0, x1, y)
----------------
spatel wrote:
> I see that this is just converting the existing code, but this would always get converted to 'shift-left' in IR. Should we add that canonicalization to SDAG as well?
I think so, the rotation/byteswap matching code has to match both patterns in several places - and there's probably more that I've missed. I'm not sure if we have anything that is relying on ADD(x,x) though. I'll add a TODO to this and do some tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78935/new/

https://reviews.llvm.org/D78935





More information about the llvm-commits mailing list