Skip to content

Commit b11ed52

Browse files
jgu222gfxbot
authored andcommitted
DeSSA handles InsertElement specially. This change separates aliasing
insertElement from non-aliasing insertElement. This change also adds code for generic aliasing handling in DeSSA. The separation is under key control. It is off for now Change-Id: I7a7fbc4b58ee7b4a902903046f9cc1f54e64a2dd
1 parent 681c917 commit b11ed52

File tree

5 files changed

+437
-83
lines changed

5 files changed

+437
-83
lines changed

IGC/Compiler/CISACodeGen/CShader.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -2281,6 +2281,24 @@ CVariable* CShader::GetSymbol(llvm::Value *value, bool fromConstantPool)
22812281
return it->second;
22822282
}
22832283

2284+
if (IGC_IS_FLAG_ENABLED(EnableDeSSAAlias) && m_deSSA->isAlias(value))
2285+
{
2286+
// Generate CVariable alias.
2287+
// Value and its aliasee must be of the same size.
2288+
Value* Aliasee = m_deSSA->getAliasee(value);
2289+
CVariable *Base = GetSymbol(Aliasee);
2290+
if (Aliasee == value) {
2291+
return Base;
2292+
}
2293+
Type *Ty = value->getType();
2294+
VectorType* VTy = dyn_cast<VectorType>(Ty);
2295+
Type *BTy = VTy ? VTy->getElementType() : Ty;
2296+
VISA_Type visaTy = GetType(BTy);
2297+
CVariable* AliasVar = GetNewAlias(Base, visaTy, 0, Base->GetNumberElement());
2298+
symbolMapping.insert(std::pair<llvm::Value*, CVariable*>(value, AliasVar));
2299+
return AliasVar;
2300+
}
2301+
22842302
if (IGC_IS_FLAG_ENABLED(EnableVariableAlias))
22852303
{
22862304
if (m_VRA->m_ValueAliasMap.count(value))

0 commit comments

Comments
 (0)