registers question

Why this code showing only 2 registers

 __global__ void IfElseKernel(int* Data, int* Data1, int size)

{

	{ 

  for( int i = 0; i < 10; ++i ) 

  { 

  int a1 = 0; 

  int a2 = 0; 

  } 

   

  for( int i = 0; i < 10; ++i ) 

  { 

  int a3 = 0; 

  int a4 = 0; 

  } 

} 

Data[0] = 1;

}
code  {

	name = IfElseKernel

	lmem = 0

	smem = 28

	reg = 2

	bar = 0

	bincode  {

  0x1000c805 0x0423c780 0x10018001 0x00000003 

  0xd00e0201 0xa0c00781 

	}

Since you never actually use the values in i or any of the a variables, the compiler nicely optimizes them away. It’s called dead code optimization. I would guess the 2 registers are 1 to hold the address of Data and one to hold the value of 1 to be written to data.