[PATCH] Fix bug in Hexagon's AnalyzeBranch function

Krzysztof Parzyszek kparzysz at codeaurora.org
Wed Mar 18 08:38:21 PDT 2015


I'm actually preparing a better one right now.

The problem was caused by incompleteness of Hexagon's InsertBranch and RemoveBranch. AnalyzeBranch handled the combination of ENDLOOP0+J2_jump, which is a loop-end branch (conditional) followed by an unconditional branch, but none of the other two functions did.

The instruction ENDLOOP0 has only one explicit operand (the loop header), the other operands are implicit uses/defs of various reserved registers.  Your patch picked up PC (program counter), and the branch insertion code interpreted a "Cond" vector with a register in it as a conditional branch, where the register is a predicate register.  As a result, the instruction was "J2_jumpt %PC", which is not valid.


http://reviews.llvm.org/D8411

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list