Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: src/IceInst.h

Issue 2124973005: Selectively invert ICMP operands for better address optimization (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address Comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceInst.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInst.h - High-level instructions ----------*- C++ -*-===// 1 //===- subzero/src/IceInst.h - High-level instructions ----------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 /// Integer comparison instruction. The source operands are captured in 532 /// Integer comparison instruction. The source operands are captured in
533 /// getSrc(0) and getSrc(1). 533 /// getSrc(0) and getSrc(1).
534 class InstIcmp : public InstHighLevel { 534 class InstIcmp : public InstHighLevel {
535 InstIcmp() = delete; 535 InstIcmp() = delete;
536 InstIcmp(const InstIcmp &) = delete; 536 InstIcmp(const InstIcmp &) = delete;
537 InstIcmp &operator=(const InstIcmp &) = delete; 537 InstIcmp &operator=(const InstIcmp &) = delete;
538 538
539 public: 539 public:
540 enum ICond { 540 enum ICond {
541 #define X(tag, str) tag, 541 #define X(tag, inverse, str) tag,
542 ICEINSTICMP_TABLE 542 ICEINSTICMP_TABLE
543 #undef X 543 #undef X
544 _num 544 _num
545 }; 545 };
546 546
547 static InstIcmp *create(Cfg *Func, ICond Condition, Variable *Dest, 547 static InstIcmp *create(Cfg *Func, ICond Condition, Variable *Dest,
548 Operand *Source1, Operand *Source2) { 548 Operand *Source1, Operand *Source2) {
549 return new (Func->allocate<InstIcmp>()) 549 return new (Func->allocate<InstIcmp>())
550 InstIcmp(Func, Condition, Dest, Source1, Source2); 550 InstIcmp(Func, Condition, Dest, Source1, Source2);
551 } 551 }
552 ICond getCondition() const { return Condition; } 552 ICond getCondition() const { return Condition; }
553 void reverseConditionAndOperands();
553 bool isMemoryWrite() const override { return false; } 554 bool isMemoryWrite() const override { return false; }
554 void dump(const Cfg *Func) const override; 555 void dump(const Cfg *Func) const override;
555 static bool classof(const Inst *Instr) { return Instr->getKind() == Icmp; } 556 static bool classof(const Inst *Instr) { return Instr->getKind() == Icmp; }
556 557
557 private: 558 private:
558 InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1, 559 InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1,
559 Operand *Source2); 560 Operand *Source2);
560 561
561 const ICond Condition; 562 ICond Condition;
562 }; 563 };
563 564
564 /// InsertElement instruction. 565 /// InsertElement instruction.
565 class InstInsertElement : public InstHighLevel { 566 class InstInsertElement : public InstHighLevel {
566 InstInsertElement() = delete; 567 InstInsertElement() = delete;
567 InstInsertElement(const InstInsertElement &) = delete; 568 InstInsertElement(const InstInsertElement &) = delete;
568 InstInsertElement &operator=(const InstInsertElement &) = delete; 569 InstInsertElement &operator=(const InstInsertElement &) = delete;
569 570
570 public: 571 public:
571 static InstInsertElement *create(Cfg *Func, Variable *Dest, Operand *Source1, 572 static InstInsertElement *create(Cfg *Func, Variable *Dest, Operand *Source1,
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 1147
1147 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; } 1148 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; }
1148 1149
1149 inline const Inst *iteratorToInst(InstList::const_iterator Iter) { 1150 inline const Inst *iteratorToInst(InstList::const_iterator Iter) {
1150 return &*Iter; 1151 return &*Iter;
1151 } 1152 }
1152 1153
1153 } // end of namespace Ice 1154 } // end of namespace Ice
1154 1155
1155 #endif // SUBZERO_SRC_ICEINST_H 1156 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « no previous file | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698