diff options
author | Brendon Cahoon <bcahoon@codeaurora.org> | 2015-04-27 14:16:43 +0000 |
---|---|---|
committer | Brendon Cahoon <bcahoon@codeaurora.org> | 2015-04-27 14:16:43 +0000 |
commit | 55bdeb7bc783a48c9970a48949de10fb802cba96 (patch) | |
tree | 588ea647197736699d58e3687197ccc933c3119a /llvm/lib/Target/Hexagon/MCTargetDesc | |
parent | d9d344b48584727c2690cce89f320ad0a09f659c (diff) | |
download | bcm5719-llvm-55bdeb7bc783a48c9970a48949de10fb802cba96.tar.gz bcm5719-llvm-55bdeb7bc783a48c9970a48949de10fb802cba96.zip |
[Hexagon] Use constant extenders to fix up hardware loops
Use a loop instruction with a constant extender for a hardware
loop instruction that is too far away from the start of the loop.
This is cheaper than changing the SA register value.
Differential Revision: http://reviews.llvm.org/D9262
llvm-svn: 235882
Diffstat (limited to 'llvm/lib/Target/Hexagon/MCTargetDesc')
-rw-r--r-- | llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp index e19910ed32f..15cda717cf1 100644 --- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp +++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp @@ -249,3 +249,17 @@ void HexagonInstPrinter::printSymbol(const MCInst *MI, unsigned OpNo, printOperand(MI, OpNo, O); O << ')'; } + +void HexagonInstPrinter::printExtBrtarget(const MCInst *MI, unsigned OpNo, + raw_ostream &O) const { + const MCOperand &MO = MI->getOperand(OpNo); + const MCInstrDesc &MII = getMII().get(MI->getOpcode()); + + assert((isExtendable(MII.TSFlags) || isExtended(MII.TSFlags)) && + "Expecting an extendable operand"); + + if (MO.isExpr() || isExtended(MII.TSFlags)) { + O << "##"; + } + printOperand(MI, OpNo, O); +} diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h index e9a548fa2b0..3fedaed8fbf 100644 --- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h +++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h @@ -56,6 +56,7 @@ namespace llvm { void printGlobalOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const; void printJumpTable(const MCInst *MI, unsigned OpNo, raw_ostream &O) const; + void printExtBrtarget(const MCInst *MI, unsigned OpNo, raw_ostream &O) const; void printConstantPool(const MCInst *MI, unsigned OpNo, raw_ostream &O) const; |