summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-11-30 20:32:54 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-11-30 20:32:54 +0000
commit97c9002f951ee13f941462c54463613eeeb13c66 (patch)
treea541e19c57a5ca6616a57f8aaed4a4d8087b6a89
parentff530efd955ae4dd1f3e40db1622da4394781441 (diff)
[Hexagon] Solo instructions cannot be used with new value jumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319470 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/Hexagon/HexagonNewValueJump.cpp3
-rw-r--r--test/CodeGen/Hexagon/newvaluejump-solo.mir19
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/Target/Hexagon/HexagonNewValueJump.cpp b/lib/Target/Hexagon/HexagonNewValueJump.cpp
index 51cf6bbd8a2..8f177d9a4ee 100644
--- a/lib/Target/Hexagon/HexagonNewValueJump.cpp
+++ b/lib/Target/Hexagon/HexagonNewValueJump.cpp
@@ -139,6 +139,9 @@ static bool canBeFeederToNewValueJump(const HexagonInstrInfo *QII,
if (II->isImplicitDef())
return false;
+ if (QII->isSolo(*II))
+ return false;
+
// Make sure there there is no 'def' or 'use' of any of the uses of
// feeder insn between it's definition, this MI and jump, jmpInst
// skipping compare, cmpInst.
diff --git a/test/CodeGen/Hexagon/newvaluejump-solo.mir b/test/CodeGen/Hexagon/newvaluejump-solo.mir
new file mode 100644
index 00000000000..b6bb23834c4
--- /dev/null
+++ b/test/CodeGen/Hexagon/newvaluejump-solo.mir
@@ -0,0 +1,19 @@
+# RUN: llc -march=hexagon -run-pass hexagon-packetizer %s -o - | FileCheck %s
+
+# Check that there is no new-value jump:
+# CHECK-LABEL: name: fred
+# CHECK-NOT: if{{.*}}cmp
+---
+name: fred
+tracksRegLiveness: true
+
+body: |
+ bb.0:
+ successors: %bb.1
+ %r0 = A2_tfrsi 0
+ %r0 = V6_extractw killed undef %v0, %r0
+ %p0 = C2_cmpeqi killed %r0, 1
+ J2_jumpf killed %p0, %bb.1, implicit-def %pc
+
+ bb.1:
+...