llvm-project/llvm/lib/Transforms/Coroutines/MaterializationUtils.h
Tyler Nowicki 2670565afc
[Coroutines] Move materialization code into its own utils (#108240)
* Move materialization out of CoroFrame to MaterializationUtils.h
* Move spill related utilities that were used by materialization to
SpillUtils
* Move isSuspendBlock (needed by materialization) to CoroInternal

See RFC for more info:
https://discourse.llvm.org/t/rfc-abi-objects-for-coroutines/81057
2024-09-12 14:01:23 -04:00

31 lines
1019 B
C++

//===- MaterializationUtils.h - Utilities for doing materialization -------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "SuspendCrossingInfo.h"
#include "llvm/IR/Instruction.h"
#ifndef LIB_TRANSFORMS_COROUTINES_MATERIALIZATIONUTILS_H
#define LIB_TRANSFORMS_COROUTINES_MATERIALIZATIONUTILS_H
namespace llvm {
namespace coro {
// True if I is trivially rematerialzable, e.g. InsertElementInst
bool isTriviallyMaterializable(Instruction &I);
// Performs rematerialization, invoked from buildCoroutineFrame.
void doRematerializations(Function &F, SuspendCrossingInfo &Checker,
std::function<bool(Instruction &)> IsMaterializable);
} // namespace coro
} // namespace llvm
#endif // LIB_TRANSFORMS_COROUTINES_MATERIALIZATIONUTILS_H