diff options
| author | Jacques Pienaar <jpienaar@google.com> | 2016-07-07 23:36:04 +0000 |
|---|---|---|
| committer | Jacques Pienaar <jpienaar@google.com> | 2016-07-07 23:36:04 +0000 |
| commit | 6d3eecc84304c0b36ed5f1ababa22cd974de1f5b (patch) | |
| tree | 7754b66e6fb7eb27a95f26e03c130a403b878559 /llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp | |
| parent | 3f36781dec71788e87779005d7c18cb78c6f163d (diff) | |
| download | bcm5719-llvm-6d3eecc84304c0b36ed5f1ababa22cd974de1f5b.tar.gz bcm5719-llvm-6d3eecc84304c0b36ed5f1ababa22cd974de1f5b.zip | |
[lanai] Use peephole optimizer to generate more conditional ALU operations.
Summary:
* Similiar to the ARM backend yse the peephole optimizer to generate more conditional ALU operations;
* Add predicated type with default always true to RR instructions in LanaiInstrInfo.td;
* Move LanaiSetflagAluCombiner into optimizeCompare;
* The ASM parser can currently only handle explicitly specified CC, so specify ".t" (true) where needed in the ASM test;
* Remove unused MachineOperand flags;
Reviewers: eliben
Subscribers: aemerson
Differential Revision: http://reviews.llvm.org/D22072
llvm-svn: 274807
Diffstat (limited to 'llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp b/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp index 4a1dcd881b5..82b720cea8d 100644 --- a/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp +++ b/llvm/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp @@ -284,6 +284,22 @@ void LanaiInstPrinter::printMemSplsOperand(const MCInst *MI, int OpNo, void LanaiInstPrinter::printCCOperand(const MCInst *MI, int OpNo, raw_ostream &OS) { - const int CC = static_cast<const int>(MI->getOperand(OpNo).getImm()); - OS << lanaiCondCodeToString(static_cast<LPCC::CondCode>(CC)); + LPCC::CondCode CC = + static_cast<LPCC::CondCode>(MI->getOperand(OpNo).getImm()); + // Handle the undefined value here for printing so we don't abort(). + if (CC >= LPCC::UNKNOWN) + OS << "<und>"; + else + OS << lanaiCondCodeToString(CC); +} + +void LanaiInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNo, + raw_ostream &OS) { + LPCC::CondCode CC = + static_cast<LPCC::CondCode>(MI->getOperand(OpNo).getImm()); + // Handle the undefined value here for printing so we don't abort(). + if (CC >= LPCC::UNKNOWN) + OS << "<und>"; + else if (CC != LPCC::ICC_T) + OS << "." << lanaiCondCodeToString(CC); } |

