[PATCH] D82911: [PowerPC][Power10] Exploit the xxspltiw and xxspltidp instructions.

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 12:59:25 PDT 2020


nemanjai added a comment.

LGTM other than the minor nit.



================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:9343
+  // turned into a 4-byte splat of 0xABABABAB.
+  if (Subtarget.hasPrefixInstrs() && SplatSize == 2)
+    return getCanonicalConstSplat((SplatBits |= SplatBits << 16), SplatSize * 2,
----------------
anil9 wrote:
> lei wrote:
> > NeHuang wrote:
> > > Is it better to combine these two conditions? Seems only the first argument of `getCanonicalConstSplat` depends on `SplatSize`.
> > > 
> > > ```
> > > if (Subtarget.hasPrefixInstrs() && (SplatSize == 2 || SplatSize == 4))
> > >   return getCanonicalConstSplat ((SplatSize == 2) ? (SplatBits |= SplatBits << 16) : SplatBits, 4, Op.getValueType(), DAG, dl)
> > > ```
> > I can do that, don't feel strongly about it either way.
> The current code is more readable than the suggested one, and was decided on after a discussion. I prefer the way it is now.
+1


================
Comment at: llvm/test/CodeGen/PowerPC/p10-splatImm-pcrel.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
----------------
Seems that this test case should have something in its name to indicate that none of the splats can use the new splat instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82911





More information about the llvm-commits mailing list