[all-commits] [llvm/llvm-project] a2b5bc: [Coroutines] Only rematerialize when operands are ...

Christian Ulmann via All-commits all-commits at lists.llvm.org
Mon Jul 13 07:38:59 PDT 2026


  Branch: refs/heads/users/dinistro/optimize-frame-remat
  Home:   https://github.com/llvm/llvm-project
  Commit: a2b5bc5d76b89fb2d254d8ad8e8a7382f7a0cb8f
      https://github.com/llvm/llvm-project/commit/a2b5bc5d76b89fb2d254d8ad8e8a7382f7a0cb8f
  Author: Christian Ulmann <christian.ulmann at nextsilicon.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M llvm/include/llvm/Transforms/Coroutines/SuspendCrossingInfo.h
    M llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp
    A llvm/test/Transforms/Coroutines/coro-materialize-check-operands.ll
    M llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll

  Log Message:
  -----------
  [Coroutines] Only rematerialize when operands are free after the suspend

CoroSplit rematerializes materializable values across suspend points based
only on their opcode, with no profitability check. When the cone bottoms out
in non-materializable leaves that are otherwise dead across the suspend, this
forces those leaves into the coroutine frame instead of spilling the single
value.

Rematerialize a value only when all of its operands are free after the suspend:
a constant, an argument, a value that already crosses a suspend independently,
or a materializable value whose own operands are all free. Otherwise spill the
value itself.

This also fixes SuspendCrossingInfo::isDefinitionAcrossSuspend(Value&), which
fell through to an llvm_unreachable when no user crossed a suspend instead of
returning false (latent, as the overload had no in-tree callers). The guard
uses this overload to test whether an operand already crosses a suspend on its
own.

coro-retcon-resume-values.ll shows the effect end to end: the retcon frame now
fits the inline buffer, dropping a heap allocation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list