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

Side by Side Diff: src/IceInst.h

Issue 691693003: Subzero: Improve the representation and handling of the FakeKill instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add an assert Created 6 years, 1 month 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 | « src/IceCfgNode.cpp ('k') | 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 // This file declares the Inst class and its target-independent 10 // This file declares the Inst class and its target-independent
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 class InstFakeKill : public InstHighLevel { 794 class InstFakeKill : public InstHighLevel {
795 InstFakeKill(const InstFakeKill &) = delete; 795 InstFakeKill(const InstFakeKill &) = delete;
796 InstFakeKill &operator=(const InstFakeKill &) = delete; 796 InstFakeKill &operator=(const InstFakeKill &) = delete;
797 797
798 public: 798 public:
799 static InstFakeKill *create(Cfg *Func, const VarList &KilledRegs, 799 static InstFakeKill *create(Cfg *Func, const VarList &KilledRegs,
800 const Inst *Linked) { 800 const Inst *Linked) {
801 return new (Func->allocateInst<InstFakeKill>()) 801 return new (Func->allocateInst<InstFakeKill>())
802 InstFakeKill(Func, KilledRegs, Linked); 802 InstFakeKill(Func, KilledRegs, Linked);
803 } 803 }
804 const VarList &getKilledRegs() const { return KilledRegs; }
804 const Inst *getLinked() const { return Linked; } 805 const Inst *getLinked() const { return Linked; }
805 void emit(const Cfg *Func) const override; 806 void emit(const Cfg *Func) const override;
806 void emitIAS(const Cfg * /* Func */) const override {} 807 void emitIAS(const Cfg * /* Func */) const override {}
807 void dump(const Cfg *Func) const override; 808 void dump(const Cfg *Func) const override;
808 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeKill; } 809 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeKill; }
809 810
810 private: 811 private:
811 InstFakeKill(Cfg *Func, const VarList &KilledRegs, const Inst *Linked); 812 InstFakeKill(Cfg *Func, const VarList &KilledRegs, const Inst *Linked);
812 ~InstFakeKill() override {} 813 ~InstFakeKill() override {}
813 814
815 const VarList &KilledRegs;
814 // This instruction is ignored if Linked->isDeleted() is true. 816 // This instruction is ignored if Linked->isDeleted() is true.
815 const Inst *Linked; 817 const Inst *Linked;
816 }; 818 };
817 819
818 // The Target instruction is the base class for all target-specific 820 // The Target instruction is the base class for all target-specific
819 // instructions. 821 // instructions.
820 class InstTarget : public Inst { 822 class InstTarget : public Inst {
821 InstTarget(const InstTarget &) = delete; 823 InstTarget(const InstTarget &) = delete;
822 InstTarget &operator=(const InstTarget &) = delete; 824 InstTarget &operator=(const InstTarget &) = delete;
823 825
824 public: 826 public:
825 uint32_t getEmitInstCount() const override { return 1; } 827 uint32_t getEmitInstCount() const override { return 1; }
826 void dump(const Cfg *Func) const override; 828 void dump(const Cfg *Func) const override;
827 static bool classof(const Inst *Inst) { return Inst->getKind() >= Target; } 829 static bool classof(const Inst *Inst) { return Inst->getKind() >= Target; }
828 830
829 protected: 831 protected:
830 InstTarget(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest) 832 InstTarget(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest)
831 : Inst(Func, Kind, MaxSrcs, Dest) { 833 : Inst(Func, Kind, MaxSrcs, Dest) {
832 assert(Kind >= Target); 834 assert(Kind >= Target);
833 } 835 }
834 ~InstTarget() override {} 836 ~InstTarget() override {}
835 }; 837 };
836 838
837 } // end of namespace Ice 839 } // end of namespace Ice
838 840
839 #endif // SUBZERO_SRC_ICEINST_H 841 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698