Question about boolean type variable generation of Global Variable Optimization

Hi all,

I have tested a simple example with '-Ox' optimization options and saw transformation from specific global variable to boolean variable. I would like to know what kind of advantages come from this .

The simplified example is as following:

Source code:
  static unsigned int g_3461 = 0xffffffff;

  unsigned int test(unsigned int a) {
    printf("g_3461=%d\n", g_3461);
    g_3461 = 0;
    return a;
  }

  int main(void) {
    int d;
    scanf("%d\n", &d);
    if (g_3461 + d) {
      test(g_3461);
      return 0;
    }
    else
      return 1;
  }

Global Variable Optimizer changes 'g_3461' variable to boolean type and its initializer becomes 'false' because this value is store once on 'test' function and it means that this variable has only two value. The users of this also are changed. The comment of code says that this exposes the values to other scalar optimizations.
The generated IR is as follows:

Generated IR:
@g_3461 = internal unnamed_addr global i1 false

define i32 @test(i32 %a) #0 {
entry:
   %.b = load i1* @g_3461