[PATCH] D21409: Emit a swap for STXVD2X when it's emitted by matching a 'store' node

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 12:36:29 PDT 2016


amehsan added inline comments.

================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:940
@@ -939,1 +939,3 @@
           (STXVD2X $rS, xoaddr:$dst)>;
+let Predicates = [IsLittleEndian] in {
+def : Pat<(store v2i64:$rS, xoaddr:$dst),
----------------
nemanjai wrote:
> timshen wrote:
> > nemanjai wrote:
> > > timshen wrote:
> > > > Without this change, powerpc le stxvd2x still works in most of the cases. Does that mean this line introduces a second code path to handle powerpc le stxvd2x? If so, can we remove the first one?
> > > I am not sure which definitions you're referring to as first and second and what you're suggesting we remove. As you can see above, I've removed the DAG pattern that was part of the instruction definition.
> > The DAG pattern "(store v2f64:$XT, xoaddr:$dst)" is for big endian, not little endian, because it doesn't consider swap at all.
> > 
> > By saying the first code path I mean PPCTargetLowering::expandVSXStoreForLE().
> But both code paths now will emit a swap. The code in PPCTargetLowering::expandVSXStoreForLE() handles more than just this pattern you mentioned. I believe the code in this patch will only ever be exercised with fast isel, but I may be wrong about that though.
This may or may not help to address the concern raised.

What we generate in PPCTargetLowering::expandVSXStoreForLE() is PPCISD::STXVD2X which is different from PPC::STXVD2X which is defined in the td file. 



Repository:
  rL LLVM

http://reviews.llvm.org/D21409





More information about the llvm-commits mailing list