kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

opt_05_frame_addr_call_arg.c (572B)


      1 /* Keep enough values live across the call to spill the cheap `&x` producer.
      2  * MIR rematerializes it as OPK_FRAME_ADDR; ABI marshalling must consume that
      3  * address recipe directly rather than demanding another optimizer temp. */
      4 __attribute__((noinline)) static void sink(int* p, ...) { *p += 1; }
      5 
      6 static int pressure(int a, int b, int c, int d, int e, int f, int g, int h) {
      7   int x = a;
      8   sink(&x, a + 1, b + 2, c + 3, d + 4, e + 5, f + 6, g + 7, h + 8);
      9   return x + a + b + c + d + e + f + g + h;
     10 }
     11 
     12 int test_main(void) { return pressure(1, 2, 3, 4, 5, 6, 7, 8); }