File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4518,6 +4518,7 @@ namespace IGC
4518
4518
SaveOption (vISA_ActiveThreadsOnlyBarrier, true );
4519
4519
}
4520
4520
4521
+ bool r0Reserved = false ;
4521
4522
if ((context->type == ShaderType::OPENCL_SHADER || context->type == ShaderType::COMPUTE_SHADER
4522
4523
|| context->type == ShaderType::RAYTRACING_SHADER) &&
4523
4524
(m_program->m_Platform ->preemptionSupported () || IGC_IS_FLAG_ENABLED (ForcePreemptionWA)) &&
@@ -4541,9 +4542,10 @@ namespace IGC
4541
4542
{
4542
4543
SaveOption (vISA_enablePreemption, true );
4543
4544
}
4545
+ r0Reserved = true ;
4544
4546
}
4545
4547
4546
- if ((context->type == ShaderType::OPENCL_SHADER || context->type == ShaderType::COMPUTE_SHADER) &&
4548
+ if (!r0Reserved && (context->type == ShaderType::OPENCL_SHADER || context->type == ShaderType::COMPUTE_SHADER) &&
4547
4549
(m_program->m_Platform ->isProductChildOf (IGFX_PVC) || IGC_IS_FLAG_ENABLED (ForcePreserveR0)))
4548
4550
{
4549
4551
// Force VISA to preserve r0 in r0 itself throughout the kernel/stackcall function.
Original file line number Diff line number Diff line change @@ -843,6 +843,12 @@ void Optimizer::accSubBeforeRA() {
843
843
844
844
bool Optimizer::R0CopyNeeded () {
845
845
if (!builder.canReadR0 ()) {
846
+ // If r0 cannot be read then r0 has to be copied
847
+ // and cannot be said to be preserved in r0. In
848
+ // other words, these 2 are mutually exclusive
849
+ // options.
850
+ vISA_ASSERT (!kernel.getOption (vISA_PreserveR0InR0),
851
+ " opposing options for r0 detected" );
846
852
return true ;
847
853
}
848
854
You can’t perform that action at this time.
0 commit comments