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

Side by Side Diff: src/IceInst.h

Issue 1506653002: Subzero: Add Non-SFI support for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 11 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 | « src/IceGlobalContext.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 /// \file 10 /// \file
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 void dump(const Cfg *Func) const override; 847 void dump(const Cfg *Func) const override;
848 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeDef; } 848 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeDef; }
849 849
850 private: 850 private:
851 InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src); 851 InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src);
852 }; 852 };
853 853
854 /// FakeUse instruction. This creates a fake use of a variable, to keep the 854 /// FakeUse instruction. This creates a fake use of a variable, to keep the
855 /// instruction that produces that variable from being dead-code eliminated. 855 /// instruction that produces that variable from being dead-code eliminated.
856 /// This is useful in a variety of lowering situations. The FakeUse instruction 856 /// This is useful in a variety of lowering situations. The FakeUse instruction
857 /// has no dest, so it can itself never be dead-code eliminated. 857 /// has no dest, so it can itself never be dead-code eliminated. A weight can
858 /// be provided to provide extra bias to the register allocator - for simplicity
859 /// of implementation, weight=N is handled by holding N copies of the variable
860 /// as source operands.
858 class InstFakeUse : public InstHighLevel { 861 class InstFakeUse : public InstHighLevel {
859 InstFakeUse() = delete; 862 InstFakeUse() = delete;
860 InstFakeUse(const InstFakeUse &) = delete; 863 InstFakeUse(const InstFakeUse &) = delete;
861 InstFakeUse &operator=(const InstFakeUse &) = delete; 864 InstFakeUse &operator=(const InstFakeUse &) = delete;
862 865
863 public: 866 public:
864 static InstFakeUse *create(Cfg *Func, Variable *Src) { 867 static InstFakeUse *create(Cfg *Func, Variable *Src, uint32_t Weight = 1) {
865 return new (Func->allocate<InstFakeUse>()) InstFakeUse(Func, Src); 868 return new (Func->allocate<InstFakeUse>()) InstFakeUse(Func, Src, Weight);
866 } 869 }
867 void emit(const Cfg *Func) const override; 870 void emit(const Cfg *Func) const override;
868 void emitIAS(const Cfg * /* Func */) const override {} 871 void emitIAS(const Cfg * /* Func */) const override {}
869 void dump(const Cfg *Func) const override; 872 void dump(const Cfg *Func) const override;
870 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeUse; } 873 static bool classof(const Inst *Inst) { return Inst->getKind() == FakeUse; }
871 874
872 private: 875 private:
873 InstFakeUse(Cfg *Func, Variable *Src); 876 InstFakeUse(Cfg *Func, Variable *Src, uint32_t Weight);
874 }; 877 };
875 878
876 /// FakeKill instruction. This "kills" a set of variables by modeling a trivial 879 /// FakeKill instruction. This "kills" a set of variables by modeling a trivial
877 /// live range at this instruction for each (implicit) variable. The primary use 880 /// live range at this instruction for each (implicit) variable. The primary use
878 /// is to indicate that scratch registers are killed after a call, so that the 881 /// is to indicate that scratch registers are killed after a call, so that the
879 /// register allocator won't assign a scratch register to a variable whose live 882 /// register allocator won't assign a scratch register to a variable whose live
880 /// range spans a call. 883 /// range spans a call.
881 /// 884 ///
882 /// The FakeKill instruction also holds a pointer to the instruction that kills 885 /// The FakeKill instruction also holds a pointer to the instruction that kills
883 /// the set of variables, so that if that linked instruction gets dead-code 886 /// the set of variables, so that if that linked instruction gets dead-code
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 static void noteHead(Ice::Inst *, Ice::Inst *) {} 989 static void noteHead(Ice::Inst *, Ice::Inst *) {}
987 void deleteNode(Ice::Inst *) {} 990 void deleteNode(Ice::Inst *) {}
988 991
989 private: 992 private:
990 mutable ilist_half_node<Ice::Inst> Sentinel; 993 mutable ilist_half_node<Ice::Inst> Sentinel;
991 }; 994 };
992 995
993 } // end of namespace llvm 996 } // end of namespace llvm
994 997
995 #endif // SUBZERO_SRC_ICEINST_H 998 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698