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

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 12:04:18 PDT 2016

nemanjai 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),
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.



More information about the llvm-commits mailing list