[llvm] r324381 - [Hexagon] Don't form new-value jumps from floating-point instructions
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 6 11:08:41 PST 2018
Author: kparzysz
Date: Tue Feb 6 11:08:41 2018
New Revision: 324381
URL: http://llvm.org/viewvc/llvm-project?rev=324381&view=rev
Log:
[Hexagon] Don't form new-value jumps from floating-point instructions
Additionally, verify that the register defined by the producer is a
32-bit register.
Added:
llvm/trunk/test/CodeGen/Hexagon/newvaluejump-float.mir
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp?rev=324381&r1=324380&r2=324381&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp Tue Feb 6 11:08:41 2018
@@ -142,6 +142,22 @@ static bool canBeFeederToNewValueJump(co
if (QII->isSolo(*II))
return false;
+ if (QII->isFloat(*II))
+ return false;
+
+ // Make sure that the (unique) def operand is a register from IntRegs.
+ bool HadDef = false;
+ for (const MachineOperand &Op : II->operands()) {
+ if (!Op.isReg() || !Op.isDef())
+ continue;
+ if (HadDef)
+ return false;
+ HadDef = true;
+ if (!Hexagon::IntRegsRegClass.contains(Op.getReg()))
+ return false;
+ }
+ assert(HadDef);
+
// 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.
Added: llvm/trunk/test/CodeGen/Hexagon/newvaluejump-float.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Hexagon/newvaluejump-float.mir?rev=324381&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Hexagon/newvaluejump-float.mir (added)
+++ llvm/trunk/test/CodeGen/Hexagon/newvaluejump-float.mir Tue Feb 6 11:08:41 2018
@@ -0,0 +1,19 @@
+# RUN: llc -march=hexagon -run-pass=hexagon-nvj %s -o - | FileCheck %s
+
+# Check that we don't generate a new-value jump for a floating-point
+# instruction.
+# CHECK-NOT: J4_cmpgti_t_jumpnv_t
+
+---
+name: fred
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: $d0
+ $r0 = F2_conv_df2w_chop $d0, implicit $usr
+ $p0 = C2_cmpgti $r0, 30
+ J2_jumpt $p0, %bb.1, implicit-def $pc
+ bb.1:
+ J2_jumpr $r31, implicit-def $pc
+...
+
More information about the llvm-commits
mailing list