[PATCH] D34627: [Power9] Disable removing extra swaps on P9 since it should not be needed.

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 07:44:49 PDT 2017


stefanp updated this revision to Diff 104861.
stefanp added a comment.

Sorry... We can't do what I wanted to do in the first place because I don't have access to the PPCSubtarget object in the PPCTargetMachine code. 
I've moved the guard into the PPCVSXSwapRemoval code.


https://reviews.llvm.org/D34627

Files:
  lib/Target/PowerPC/PPCVSXSwapRemoval.cpp


Index: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
===================================================================
--- lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
+++ lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
@@ -195,8 +195,10 @@
       return false;
 
     // If we don't have VSX on the subtarget, don't do anything.
+    // Also, on Power 9 the load and store ops preserve element order and so
+    // the swaps are not required.
     const PPCSubtarget &STI = MF.getSubtarget<PPCSubtarget>();
-    if (!STI.hasVSX())
+    if (!STI.hasVSX() || !STI.needsSwapsForVSXMemOps())
       return false;
 
     bool Changed = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34627.104861.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170630/171a896c/attachment.bin>


More information about the llvm-commits mailing list