[llvm] r341409 - [Hexagon] Don't packetize new-value stores with any other stores
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 4 14:07:27 PDT 2018
Author: kparzysz
Date: Tue Sep 4 14:07:27 2018
New Revision: 341409
URL: http://llvm.org/viewvc/llvm-project?rev=341409&view=rev
Log:
[Hexagon] Don't packetize new-value stores with any other stores
Added:
llvm/trunk/test/CodeGen/Hexagon/packetize-nvstore.mir
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp?rev=341409&r1=341408&r2=341409&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp Tue Sep 4 14:07:27 2018
@@ -1112,6 +1112,10 @@ static bool cannotCoexistAsymm(const Mac
return MJ.isInlineAsm() || MJ.isBranch() || MJ.isBarrier() ||
MJ.isCall() || MJ.isTerminator();
+ // New-value stores cannot coexist with any other stores.
+ if (HII.isNewValueStore(MI) && MJ.mayStore())
+ return true;
+
switch (MI.getOpcode()) {
case Hexagon::S2_storew_locked:
case Hexagon::S4_stored_locked:
@@ -1654,6 +1658,9 @@ bool HexagonPacketizerList::isLegalToPru
return false;
}
+ if (!Coexist)
+ return false;
+
if (ChangedOffset == INT64_MAX && updateOffset(SUI, SUJ)) {
FoundSequentialDependence = false;
Dependence = false;
Added: llvm/trunk/test/CodeGen/Hexagon/packetize-nvstore.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Hexagon/packetize-nvstore.mir?rev=341409&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Hexagon/packetize-nvstore.mir (added)
+++ llvm/trunk/test/CodeGen/Hexagon/packetize-nvstore.mir Tue Sep 4 14:07:27 2018
@@ -0,0 +1,25 @@
+# RUN: llc -march=hexagon -start-before=hexagon-packetizer -o - %s | FileCheck %s
+# This used to generate an invalid packet:
+# {
+# r1 = #0
+# memw(r0++#4) = r1.new // new-value store must be the only store
+# memw(r0+#0) = #0
+# }
+#
+# CHECK: memw
+# CHECK: }
+# CHECK: memw
+
+---
+name: f0
+tracksRegLiveness: true
+stack:
+ - { id: 0, size: 8, alignment: 8 }
+body: |
+ bb.0:
+ liveins: $r0
+ renamable $r1 = A2_tfrsi 0
+ renamable $r0 = S2_storeri_pi renamable $r0, 4, killed renamable $r1 :: (store 4 into %stack.0)
+ S4_storeiri_io renamable $r0, 0, 0 :: (store 4 into %stack.0 + 4)
+ J2_jumpr $r31, implicit-def $pc
+...
More information about the llvm-commits
mailing list