[PATCH] Fix bug in Hexagon's AnalyzeBranch function

Daniel Jasper djasper at google.com
Wed Mar 18 04:18:28 PDT 2015


Hi qcolombet,

This was surfaced by r231064 which introduces more critical edge splitting.

This fixes llvm.org/PR22767.

http://reviews.llvm.org/D8411

Files:
  lib/Target/Hexagon/HexagonInstrInfo.cpp
  test/CodeGen/Hexagon/hwloop-cleanup.ll

Index: lib/Target/Hexagon/HexagonInstrInfo.cpp
===================================================================
--- lib/Target/Hexagon/HexagonInstrInfo.cpp
+++ lib/Target/Hexagon/HexagonInstrInfo.cpp
@@ -303,7 +303,7 @@
   if (SecLastOpcode == Hexagon::ENDLOOP0 &&
       LastOpcode == Hexagon::J2_jump) {
     TBB = SecondLastInst->getOperand(0).getMBB();
-    Cond.push_back(SecondLastInst->getOperand(0));
+    Cond.push_back(SecondLastInst->getOperand(1));
     FBB = LastInst->getOperand(0).getMBB();
     return false;
   }
Index: test/CodeGen/Hexagon/hwloop-cleanup.ll
===================================================================
--- test/CodeGen/Hexagon/hwloop-cleanup.ll
+++ test/CodeGen/Hexagon/hwloop-cleanup.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
+; RUN: llc -march=hexagon -mcpu=hexagonv4 -no-phi-elim-live-out-early-exit < %s | FileCheck %s
 ; Check that we remove the compare and induction variable instructions
 ; after generating hardware loops.
 ; Bug 6685.

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8411.22172.patch
Type: text/x-patch
Size: 1029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150318/76d128fe/attachment.bin>


More information about the llvm-commits mailing list