Skip to content

Commit

Permalink
[cilk2c_inlined] Add dummy function to prevent LLVM's optimizer from …
Browse files Browse the repository at this point in the history
…erasing the __cilkrts_stack_frame type when generating the bitcode ABI file.
  • Loading branch information
neboat committed Jan 17, 2025
1 parent 3062cd3 commit 07518a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/cilk2c_inlined.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,16 @@ __cilk_helper_epilogue_exn(__cilkrts_stack_frame *sf,
__cilkrts_pause_frame(sf, parent, exn, spawner);
}

// Internal helper function to ensure the __cilkrts_stack_frame type is present
// in the bitcode file. Does not end up in compiled Cilk code nor the OpenCilk
// runtime library.
CHEETAH_INTERNAL __cilkrts_stack_frame
__internal_preserve_stack_frame_type_helper(void) {
__cilkrts_stack_frame sf;
__cilkrts_enter_frame(&sf);
return sf;
}

/// Computes a grainsize for a cilk_for loop, using the following equation:
///
/// grainsize = min(2048, ceil(n / (8 * nworkers)))
Expand Down

0 comments on commit 07518a4

Please sign in to comment.