Skip to content

Commit 72aec76

Browse files
srividyakarumuriigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 29b2b1a
Support for uniform typed read
1 parent 394fd62 commit 72aec76

File tree

4 files changed

+10
-40
lines changed

4 files changed

+10
-40
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11182,7 +11182,7 @@ void EmitPass::JoinSIMD(CVariable* (&tempdst)[N], uint responseLength, SIMDMode
1118211182
}
1118311183
}
1118411184

11185-
CVariable* EmitPass::BroadcastIfUniform(CVariable* pVar, bool nomask)
11185+
CVariable* EmitPass::BroadcastIfUniform(CVariable* pVar)
1118611186
{
1118711187
IGC_ASSERT_MESSAGE(nullptr != pVar, "pVar is null");
1118811188
VISA_Type VarT = pVar->GetType();
@@ -11215,16 +11215,12 @@ CVariable* EmitPass::BroadcastIfUniform(CVariable* pVar, bool nomask)
1121511215

1121611216
for (uint i = 0; i < elts; ++i)
1121711217
{
11218-
if (nomask)
11219-
m_encoder->SetNoMask();
1122011218
m_encoder->SetSrcSubReg(0, i * Stride);
1122111219
if (Stride != 1) m_encoder->SetDstRegion(Stride);
1122211220
m_encoder->SetDstSubReg((i * Stride) * width);
1122311221
m_encoder->Copy(Dst, ImmLo ? ImmLo : Src);
1122411222
m_encoder->Push();
1122511223
if (Need64BitEmu) {
11226-
if (nomask)
11227-
m_encoder->SetNoMask();
1122811224
m_encoder->SetSrcSubReg(0, i * Stride + 1);
1122911225
if (Stride != 1) m_encoder->SetDstRegion(Stride);
1123011226
m_encoder->SetDstSubReg((i * Stride) * width + 1);
@@ -13356,52 +13352,28 @@ void EmitPass::emitTypedRead(llvm::Instruction* pInsn)
1335613352
CVariable* pV = (pR == nullptr && isUndefOrConstInt0(pllV)) ? nullptr : GetSymbol(pllV);
1335713353
CVariable* pU = GetSymbol(pllU);
1335813354

13359-
pU = BroadcastIfUniform(pU, m_currShader->GetIsUniform(pInsn));
13360-
pV = pV ? BroadcastIfUniform(pV, m_currShader->GetIsUniform(pInsn)) : nullptr;
13361-
pR = pR ? BroadcastIfUniform(pR, m_currShader->GetIsUniform(pInsn)) : nullptr;
13362-
pLOD = pLOD ? BroadcastIfUniform(pLOD, m_currShader->GetIsUniform(pInsn)) : nullptr;
13355+
pU = BroadcastIfUniform(pU);
13356+
pV = pV ? BroadcastIfUniform(pV) : nullptr;
13357+
pR = pR ? BroadcastIfUniform(pR) : nullptr;
13358+
pLOD = pLOD ? BroadcastIfUniform(pLOD) : nullptr;
1336313359

1336413360
ResourceDescriptor resource = GetResourceVariable(pllSrcBuffer);
1336513361

1336613362
uint numChannels = iSTD::BitCount(writeMask);
13367-
SIMDMode instWidth = std::min(
13368-
m_currShader->m_Platform->supportsSIMD16TypedRW() ? SIMDMode::SIMD16 : SIMDMode::SIMD8,
13369-
m_currShader->m_SIMDSize);
1337013363

1337113364
if (m_currShader->GetIsUniform(pInsn))
1337213365
{
13373-
CVariable* tempdst = nullptr;
13374-
tempdst = m_currShader->GetNewVariable(
13375-
numChannels * numLanes(instWidth),
13376-
ISA_TYPE_F,
13377-
EALIGN_GRF,
13378-
CName("tempDest"));
13379-
m_encoder->SetSimdSize(instWidth);
13380-
m_encoder->SetPredicate(nullptr);
13381-
m_encoder->SetNoMask();
13382-
m_encoder->TypedRead4(resource, pU, pV, pR, pLOD, tempdst, writeMask);
13383-
13384-
m_encoder->Push();
13385-
13386-
// Mov the required channel values to m_destination
13387-
m_encoder->SetSimdSize(SIMDMode::SIMD1);
13388-
m_encoder->SetNoMask();
13389-
13390-
uint32_t width8 = getGRFSize() / 4;
13391-
for (uint i = 0; i < numChannels; ++i)
13392-
{
13393-
m_encoder->SetSrcSubReg(0, i * width8);
13394-
m_encoder->SetDstSubReg(i);
13395-
m_encoder->Copy(m_destination, tempdst);
13396-
m_encoder->Push();
13397-
}
13366+
IGC_ASSERT_MESSAGE(0, "Uniform ld_uav_typed not implemented yet");
1339813367
}
1339913368
else
1340013369
{
1340113370
uint label = 0;
1340213371
CVariable* flag = nullptr;
1340313372
bool needLoop = ResourceLoopHeader(resource, flag, label);
1340413373
CVariable* tempdst[4] = { nullptr, nullptr, nullptr, nullptr };
13374+
SIMDMode instWidth = std::min(
13375+
m_currShader->m_Platform->supportsSIMD16TypedRW() ? SIMDMode::SIMD16 : SIMDMode::SIMD8,
13376+
m_currShader->m_SIMDSize);
1340513377
bool needsSplit = m_currShader->m_SIMDSize > instWidth;
1340613378

1340713379
if (!needsSplit)

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class EmitPass : public llvm::FunctionPass
464464
void SplitSIMD(llvm::Instruction* inst, uint numSources, uint headerSize, CVariable* payload, SIMDMode mode, uint half);
465465
template<size_t N>
466466
void JoinSIMD(CVariable* (&tempdst)[N], uint responseLength, SIMDMode mode);
467-
CVariable* BroadcastIfUniform(CVariable* pVar, bool nomask = false);
467+
CVariable* BroadcastIfUniform(CVariable* pVar);
468468
uint DecideInstanceAndSlice(const llvm::BasicBlock& blk, SDAG& sdag, bool& slicing);
469469
bool IsUndefOrZeroImmediate(const llvm::Value* value);
470470
inline bool isUndefOrConstInt0(const llvm::Value* val)

IGC/Compiler/CISACodeGen/WIAnalysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,6 @@ WIAnalysis::WIDependancy WIAnalysisRunner::calculate_dep(const CallInst* inst)
12221222
intrinsic_name == llvm_waveAll ||
12231223
intrinsic_name == llvm_waveClustered ||
12241224
intrinsic_name == llvm_ld_ptr ||
1225-
(IGC_IS_FLAG_DISABLED(DisableUniformTypedAccess) && intrinsic_name == llvm_typed_read) ||
12261225
intrinsic_name == llvm_add_pair ||
12271226
intrinsic_name == llvm_sub_pair ||
12281227
intrinsic_name == llvm_mul_pair ||

IGC/common/igc_flags.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ DECLARE_IGC_REGKEY(bool, DisableConstantCoalescing, false, "Setting this to
111111
DECLARE_IGC_REGKEY(bool, DisableConstantCoalescingOutOfBoundsCheck, false, "Setting this to 1/true adds a compiler switch to disable constant coalesing out of bounds check", false)
112112
DECLARE_IGC_REGKEY(bool, UseHDCTypedReadForAllTextures, false, "Setting this to use HDC message rather than sampler ld for texture read", false)
113113
DECLARE_IGC_REGKEY(bool, UseHDCTypedReadForAllTypedBuffers, false, "Setting this to use HDC message rather than sampler ld for buffer read", false)
114-
DECLARE_IGC_REGKEY(bool, DisableUniformTypedAccess, false, "Setting this will disable uniform typed access handling", false)
115114
DECLARE_IGC_REGKEY(bool, DisableURBWriteMerge, false, "Setting this to 1/true adds a compiler switch to disable URB write merge", false)
116115
DECLARE_IGC_REGKEY(bool, DisableEmptyBlockRemoval, false, "Setting this to 1/true adds a compiler switch to disable empty block optimization", false)
117116
DECLARE_IGC_REGKEY(bool, DisableSIMD32Slicing, false, "Setting this to 1/true adds a compiler switch to disable emitting SIMD32 VISA code in slices", false)

0 commit comments

Comments
 (0)