Skip to content

Commit cde90e2

Browse files
KorovinVladigcbot
authored andcommitted
Set 128 grf size by default
.
1 parent f239ed0 commit cde90e2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ static void addKernelAttrsFromMetadata(VISAKernel &Kernel,
949949
Kernel.AddKernelAttribute("NBarrierCnt", sizeof(BarrierCnt), &BarrierCnt);
950950
}
951951

952-
int NumGRF = -1;
952+
// Default number of registers.
953+
unsigned NumGRF = 128;
953954
// Set by compile option.
954955
if (BC->isAutoLargeGRFMode())
955956
NumGRF = 0;
@@ -961,9 +962,7 @@ static void addKernelAttrsFromMetadata(VISAKernel &Kernel,
961962
if (NumGRFPerKernel == 0 || Subtarget->isValidGRFSize(NumGRFPerKernel))
962963
NumGRF = NumGRFPerKernel;
963964
}
964-
965-
if (NumGRF != -1)
966-
Kernel.AddKernelAttribute("NumGRF", sizeof(NumGRF), &NumGRF);
965+
Kernel.AddKernelAttribute("NumGRF", sizeof(NumGRF), &NumGRF);
967966
}
968967

969968
// Legalize name for using as filename or in visa asm

IGC/VectorCompiler/test/CisaBuilder/grf_size.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ define dllexport spir_kernel void @test_auto(i32 %arg) #0 {
2727
ret void
2828
}
2929

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

35-
; CHECK-NOT: .kernel_attr NumGRF
35+
; CHECK: .kernel_attr NumGRF=128
3636
define dllexport spir_kernel void @test_invalid(i32 %arg) #0 {
3737
ret void
3838
}

0 commit comments

Comments
 (0)