Skip to content

Commit

Permalink
Revert "Set 128 grf size by default"
Browse files Browse the repository at this point in the history
.
  • Loading branch information
AnBodrova authored and igcbot committed Jan 9, 2025
1 parent 18ea0df commit 105c44c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,7 @@ static void addKernelAttrsFromMetadata(VISAKernel &Kernel,
Kernel.AddKernelAttribute("NBarrierCnt", sizeof(BarrierCnt), &BarrierCnt);
}

// Default number of registers.
unsigned NumGRF = 128;
int NumGRF = -1;
// Set by compile option.
if (BC->isAutoLargeGRFMode())
NumGRF = 0;
Expand All @@ -962,7 +961,9 @@ static void addKernelAttrsFromMetadata(VISAKernel &Kernel,
if (NumGRFPerKernel == 0 || Subtarget->isValidGRFSize(NumGRFPerKernel))
NumGRF = NumGRFPerKernel;
}
Kernel.AddKernelAttribute("NumGRF", sizeof(NumGRF), &NumGRF);

if (NumGRF != -1)
Kernel.AddKernelAttribute("NumGRF", sizeof(NumGRF), &NumGRF);
}

// Legalize name for using as filename or in visa asm
Expand Down
4 changes: 2 additions & 2 deletions IGC/VectorCompiler/test/CisaBuilder/grf_size.ll
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ define dllexport spir_kernel void @test_auto(i32 %arg) #0 {
ret void
}

; CHECK: .kernel_attr NumGRF=128
; CHECK-NOT: .kernel_attr NumGRF
define dllexport spir_kernel void @test_default(i32 %arg) #0 {
ret void
}

; CHECK: .kernel_attr NumGRF=128
; CHECK-NOT: .kernel_attr NumGRF
define dllexport spir_kernel void @test_invalid(i32 %arg) #0 {
ret void
}
Expand Down

0 comments on commit 105c44c

Please sign in to comment.