[PATCH] D108539: [X86][AVX] Attempt to fold a scaled index into a gather/scatter scale immediate (PR13310)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 12:16:15 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:50252
+      if (N->getOpcode() == X86ISD::MGATHER)
+        return getAVX2GatherNode(N->getOpcode(), SDValue(N, 0), DAG,
+                                 MemOp->getOperand(1), Mask,
----------------
Is there a common helper function we can split off of getAVX2GatherNode and getGatherNode to use here. Most of the code in getAVX2GatherNode isn't needed for this path and the Mask handling in getAVX2GatherNode happens to work for AVX512 gathers, but wasn't intentional.

The helper could probably be shared with the getMemIntrinsicNode call in LowerMGATHER as well.

Similar for getScatterNode and the getMemIntrinsicNode call in LowerMSCATTER.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108539



More information about the llvm-commits mailing list