Skip to content

Commit 96b9a20

Browse files
trbauersys_zuul
authored andcommitted
This change reverts both of the last changes to CVariable.
Change-Id: I5f390e2be541d1da1e2f694725eb30dac204d3ae
1 parent 91da13c commit 96b9a20

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed

IGC/Compiler/CISACodeGen/CVariable.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ CVariable::CVariable(uint16_t nbElement, bool uniform, VISA_Type type,
6565
m_undef(false),
6666
m_isUnpacked(false)
6767
{
68-
visaGenVariable[0] = visaGenVariable[1] = nullptr;
6968
}
7069

7170
static unsigned
@@ -109,7 +108,6 @@ CVariable::CVariable(CVariable* var, VISA_Type type, uint16_t offset,
109108
m_undef(false),
110109
m_isUnpacked(false)
111110
{
112-
visaGenVariable[0] = visaGenVariable[1] = nullptr;
113111
if (numElements)
114112
{
115113
m_nbElement = numElements;
@@ -141,15 +139,24 @@ CVariable::CVariable(uint64_t immediate, VISA_Type type) :
141139
m_undef(false),
142140
m_isUnpacked(false)
143141
{
144-
visaGenVariable[0] = visaGenVariable[1] = nullptr;
142+
145143
}
146144

147145
/// CVariable constructor, for undef
148146
///
149-
CVariable::CVariable(VISA_Type type)
150-
: CVariable(0, type) // undef variable are represented as immediate
147+
CVariable::CVariable(VISA_Type type) :
148+
m_immediateValue(0),
149+
m_alias(nullptr),
150+
m_nbElement(0),
151+
m_numberOfInstance(1),
152+
m_type(type),
153+
m_varType(EVARTYPE_GENERAL),
154+
m_uniform(true),
155+
m_isImmediate(true),
156+
m_subspanUse(false),
157+
m_uniformVector(false),
158+
m_undef(true),
159+
m_isUnpacked(false)
151160
{
152-
// fields are all the same as immediate except for these
153-
m_nbElement = 0;
154-
m_undef = true;
161+
// undef variable are represented as immediate but can considered as trash data
155162
}

IGC/Compiler/CISACodeGen/CVariable.hpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ namespace IGC {
5454
// Copy Ctor
5555
CVariable(const CVariable& V)
5656
{
57-
// the only differences
58-
m_alias = nullptr;
59-
m_aliasOffset = 0;
60-
// everything else is the same
6157
m_immediateValue = V.m_immediateValue;
58+
m_alias = nullptr;
6259
m_nbElement = V.m_nbElement;
60+
m_aliasOffset = 0;
6361
m_numberOfInstance = V.m_numberOfInstance;
6462
m_type = V.m_type;
6563
m_varType = V.m_varType;
@@ -70,11 +68,10 @@ namespace IGC {
7068
m_uniformVector = V.m_uniformVector;
7169
m_undef = V.m_undef;
7270
m_isUnpacked = V.m_isUnpacked;
73-
visaGenVariable[0] = V.visaGenVariable[0];
74-
visaGenVariable[1] = V.visaGenVariable[1];
7571
}
7672

77-
e_alignment GetAlign() const {
73+
e_alignment GetAlign() const
74+
{
7875
assert(!m_isImmediate && "Calling GetAlign() on an immediate returns undefined result");
7976
return m_align;
8077
}
@@ -83,9 +80,9 @@ namespace IGC {
8380
uint16_t GetNumberElement() const { return m_nbElement; }
8481
bool IsUniform() const { return m_uniform; }
8582

86-
uint GetSize() const { return m_nbElement * CEncoder::GetCISADataTypeSize(m_type); }
83+
uint GetSize() { return m_nbElement * CEncoder::GetCISADataTypeSize(m_type); }
8784

88-
uint GetElemSize() const { return CEncoder::GetCISADataTypeSize(m_type); }
85+
uint GetElemSize() { return CEncoder::GetCISADataTypeSize(m_type); }
8986
CVariable* GetAlias() { return m_alias; }
9087
uint16_t GetAliasOffset() const { return m_aliasOffset; }
9188
VISA_Type GetType() const { return m_type; }
@@ -103,19 +100,20 @@ namespace IGC {
103100
bool IsVectorUniform() const { return m_uniformVector; }
104101
uint8_t GetNumberInstance() const { return m_numberOfInstance; }
105102
bool IsUndef() const { return m_undef; }
106-
bool IsGRFAligned(e_alignment requiredAlign = EALIGN_GRF) const {
103+
bool IsGRFAligned(e_alignment requiredAlign = EALIGN_GRF) const
104+
{
107105
e_alignment align = GetAlign();
108106
if (requiredAlign == EALIGN_GRF)
109107
return align == EALIGN_GRF || align == EALIGN_2GRF;
110108
return align == requiredAlign;
111109
}
112110

113111
void setisUnpacked() { m_isUnpacked = true; }
114-
bool isUnpacked() const { return m_isUnpacked; }
115-
uint8_t getOffsetMultiplier() const { return (m_isUnpacked) ? 2 : 1; }
112+
bool isUnpacked() { return m_isUnpacked; }
113+
uint8_t getOffsetMultiplier() { return (m_isUnpacked) ? 2 : 1; }
116114
void ResolveAlias();
117115

118-
// two pointers wide
116+
// 4 bytes
119117
union {
120118
VISA_GenVar* visaGenVariable[2];
121119
VISA_SurfaceVar* visaSurfVariable;
@@ -148,7 +146,7 @@ namespace IGC {
148146
// 8 bytes
149147
uint64_t m_immediateValue;
150148

151-
// 4 or 8 sizeof pointer
149+
// 4 bytes - pointer
152150
CVariable* m_alias;
153151

154152
// 2 bytes types

0 commit comments

Comments
 (0)