| OLD | NEW |
| 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 MBS_MultiBlock // Several uses across several blocks | 973 MBS_MultiBlock // Several uses across several blocks |
| 974 }; | 974 }; |
| 975 VariableTracking() = default; | 975 VariableTracking() = default; |
| 976 VariableTracking(const VariableTracking &) = default; | 976 VariableTracking(const VariableTracking &) = default; |
| 977 VariableTracking &operator=(const VariableTracking &) = default; | 977 VariableTracking &operator=(const VariableTracking &) = default; |
| 978 VariableTracking(MultiBlockState MultiBlock) : MultiBlock(MultiBlock) {} | 978 VariableTracking(MultiBlockState MultiBlock) : MultiBlock(MultiBlock) {} |
| 979 MultiDefState getMultiDef() const { return MultiDef; } | 979 MultiDefState getMultiDef() const { return MultiDef; } |
| 980 MultiBlockState getMultiBlock() const { return MultiBlock; } | 980 MultiBlockState getMultiBlock() const { return MultiBlock; } |
| 981 const Inst *getFirstDefinitionSingleBlock() const; | 981 const Inst *getFirstDefinitionSingleBlock() const; |
| 982 const Inst *getSingleDefinition() const; | 982 const Inst *getSingleDefinition() const; |
| 983 const CfgNode *getSingleDefinitionNode() const; |
| 983 const Inst *getFirstDefinition() const; | 984 const Inst *getFirstDefinition() const; |
| 984 const InstDefList &getLatterDefinitions() const { return Definitions; } | 985 const InstDefList &getLatterDefinitions() const { return Definitions; } |
| 985 CfgNode *getNode() const { return SingleUseNode; } | 986 CfgNode *getNode() const { return SingleUseNode; } |
| 986 RegWeight getUseWeight() const { return UseWeight; } | 987 RegWeight getUseWeight() const { return UseWeight; } |
| 987 void markUse(MetadataKind TrackingKind, const Inst *Instr, CfgNode *Node, | 988 void markUse(MetadataKind TrackingKind, const Inst *Instr, CfgNode *Node, |
| 988 bool IsImplicit); | 989 bool IsImplicit); |
| 989 void markDef(MetadataKind TrackingKind, const Inst *Instr, CfgNode *Node); | 990 void markDef(MetadataKind TrackingKind, const Inst *Instr, CfgNode *Node); |
| 990 | 991 |
| 991 private: | 992 private: |
| 992 MultiDefState MultiDef = MDS_Unknown; | 993 MultiDefState MultiDef = MDS_Unknown; |
| 993 MultiBlockState MultiBlock = MBS_Unknown; | 994 MultiBlockState MultiBlock = MBS_Unknown; |
| 994 CfgNode *SingleUseNode = nullptr; | 995 CfgNode *SingleUseNode = nullptr; |
| 995 CfgNode *SingleDefNode = nullptr; | 996 CfgNode *SingleDefNode = nullptr; |
| 996 /// All definitions of the variable are collected in Definitions[] (except for | 997 /// All definitions of the variable are collected in Definitions[] (except for |
| 997 /// the earliest definition), in increasing order of instruction number. | 998 /// the earliest definition), in increasing order of instruction number. |
| 998 InstDefList Definitions; /// Only used if Kind==VMK_All | 999 InstDefList Definitions; /// Only used if Kind==VMK_All |
| 999 const Inst *FirstOrSingleDefinition = nullptr; | 1000 const Inst *FirstOrSingleDefinition = nullptr; |
| 1001 const CfgNode *FirstOrSingleDefinitionNode = nullptr; |
| 1000 RegWeight UseWeight; | 1002 RegWeight UseWeight; |
| 1001 }; | 1003 }; |
| 1002 | 1004 |
| 1003 /// VariablesMetadata analyzes and summarizes the metadata for the complete set | 1005 /// VariablesMetadata analyzes and summarizes the metadata for the complete set |
| 1004 /// of Variables. | 1006 /// of Variables. |
| 1005 class VariablesMetadata { | 1007 class VariablesMetadata { |
| 1006 VariablesMetadata() = delete; | 1008 VariablesMetadata() = delete; |
| 1007 VariablesMetadata(const VariablesMetadata &) = delete; | 1009 VariablesMetadata(const VariablesMetadata &) = delete; |
| 1008 VariablesMetadata &operator=(const VariablesMetadata &) = delete; | 1010 VariablesMetadata &operator=(const VariablesMetadata &) = delete; |
| 1009 | 1011 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1027 bool isMultiDef(const Variable *Var) const; | 1029 bool isMultiDef(const Variable *Var) const; |
| 1028 /// Returns the first definition instruction of the given Variable. This is | 1030 /// Returns the first definition instruction of the given Variable. This is |
| 1029 /// only valid for variables whose definitions are all within the same block, | 1031 /// only valid for variables whose definitions are all within the same block, |
| 1030 /// e.g. T after the lowered sequence "T=B; T+=C; A=T", for which | 1032 /// e.g. T after the lowered sequence "T=B; T+=C; A=T", for which |
| 1031 /// getFirstDefinitionSingleBlock(T) would return the "T=B" instruction. For | 1033 /// getFirstDefinitionSingleBlock(T) would return the "T=B" instruction. For |
| 1032 /// variables with definitions span multiple blocks, nullptr is returned. | 1034 /// variables with definitions span multiple blocks, nullptr is returned. |
| 1033 const Inst *getFirstDefinitionSingleBlock(const Variable *Var) const; | 1035 const Inst *getFirstDefinitionSingleBlock(const Variable *Var) const; |
| 1034 /// Returns the definition instruction of the given Variable, when the | 1036 /// Returns the definition instruction of the given Variable, when the |
| 1035 /// variable has exactly one definition. Otherwise, nullptr is returned. | 1037 /// variable has exactly one definition. Otherwise, nullptr is returned. |
| 1036 const Inst *getSingleDefinition(const Variable *Var) const; | 1038 const Inst *getSingleDefinition(const Variable *Var) const; |
| 1039 const CfgNode *getSingleDefinitionNode(const Variable *Var) const; |
| 1037 /// getFirstDefinition() and getLatterDefinitions() are used together to | 1040 /// getFirstDefinition() and getLatterDefinitions() are used together to |
| 1038 /// return the complete set of instructions that define the given Variable, | 1041 /// return the complete set of instructions that define the given Variable, |
| 1039 /// regardless of whether the definitions are within the same block (in | 1042 /// regardless of whether the definitions are within the same block (in |
| 1040 /// contrast to getFirstDefinitionSingleBlock). | 1043 /// contrast to getFirstDefinitionSingleBlock). |
| 1041 const Inst *getFirstDefinition(const Variable *Var) const; | 1044 const Inst *getFirstDefinition(const Variable *Var) const; |
| 1042 const InstDefList &getLatterDefinitions(const Variable *Var) const; | 1045 const InstDefList &getLatterDefinitions(const Variable *Var) const; |
| 1043 | 1046 |
| 1044 /// Returns whether the given Variable is live across multiple blocks. Mainly, | 1047 /// Returns whether the given Variable is live across multiple blocks. Mainly, |
| 1045 /// this is used to partition Variables into single-block versus multi-block | 1048 /// this is used to partition Variables into single-block versus multi-block |
| 1046 /// sets for leveraging sparsity in liveness analysis, and for implementing | 1049 /// sets for leveraging sparsity in liveness analysis, and for implementing |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 return Operand->getKind() == kVariableBoolean; | 1092 return Operand->getKind() == kVariableBoolean; |
| 1090 } | 1093 } |
| 1091 | 1094 |
| 1092 private: | 1095 private: |
| 1093 Variable *BoolSource = nullptr; | 1096 Variable *BoolSource = nullptr; |
| 1094 }; | 1097 }; |
| 1095 | 1098 |
| 1096 } // end of namespace Ice | 1099 } // end of namespace Ice |
| 1097 | 1100 |
| 1098 #endif // SUBZERO_SRC_ICEOPERAND_H | 1101 #endif // SUBZERO_SRC_ICEOPERAND_H |
| OLD | NEW |