[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
Wed Jun 15 14:43:46 PDT 2016


nemanjai created this revision.
nemanjai added reviewers: timshen, echristo, wschmidt, hfinkel, kbarton, amehsan.
nemanjai added a subscriber: llvm-commits.
nemanjai set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.

PR 28130 points out that we have a missing swap prior to a permuting vector store with fast isel. This patch changes the dag patterns for STXVD2X to make them endianness-sensitive.

Repository:
  rL LLVM

http://reviews.llvm.org/D21409

Files:
  lib/Target/PowerPC/PPCInstrVSX.td

Index: lib/Target/PowerPC/PPCInstrVSX.td
===================================================================
--- lib/Target/PowerPC/PPCInstrVSX.td
+++ lib/Target/PowerPC/PPCInstrVSX.td
@@ -124,7 +124,7 @@
     def STXVD2X : XX1Form<31, 972,
                          (outs), (ins vsrc:$XT, memrr:$dst),
                          "stxvd2x $XT, $dst", IIC_LdStSTFD,
-                         [(store v2f64:$XT, xoaddr:$dst)]>;
+                         []>;
 
     def STXVW4X : XX1Form<31, 908,
                          (outs), (ins vsrc:$XT, memrr:$dst),
@@ -937,7 +937,16 @@
 // Stores.
 def : Pat<(int_ppc_vsx_stxvd2x v2f64:$rS, xoaddr:$dst),
           (STXVD2X $rS, xoaddr:$dst)>;
+let Predicates = [IsLittleEndian] in {
+def : Pat<(store v2i64:$rS, xoaddr:$dst),
+          (STXVD2X (XXPERMDI $rS, $rS, 2), xoaddr:$dst)>;
+def : Pat<(store v2f64:$rS, xoaddr:$dst),
+          (STXVD2X (XXPERMDI $rS, $rS, 2), xoaddr:$dst)>;
+}
+let Predicates = [IsBigEndian] in {
 def : Pat<(store v2i64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;
+def : Pat<(store v2f64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;
+}
 def : Pat<(int_ppc_vsx_stxvw4x v4i32:$rS, xoaddr:$dst),
           (STXVW4X $rS, xoaddr:$dst)>;
 def : Pat<(PPCstxvd2x v2f64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21409.60895.patch
Type: text/x-patch
Size: 1291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/0d588427/attachment.bin>


More information about the llvm-commits mailing list