https://github.com/shader-slang/slang
Raw File
Tip revision: 5902acdabc4445a65741a7a6a3a95f223e301059 authored by Yong He on 23 January 2024, 07:19:40 UTC
[LSP] Fetch configs directly from didConfigurationChanged message. (#3478)
Tip revision: 5902acd
slang-ir-eliminate-phis.h
// slang-ir-eliminate-phis.h
#pragma once

#include "slang-ir-liveness.h"

namespace Slang
{
    struct CodeGenContext;
    struct IRModule;

    struct PhiEliminationOptions
    {
        bool eliminateCompositeTypedPhiOnly = false;
        bool useRegisterAllocation = true;
        static PhiEliminationOptions getFast() { return PhiEliminationOptions{ false, false }; }
    };

        /// Eliminate all "phi nodes" from the given `module`.
        ///
        /// This process moves the code in `module` *out* of SSA form,
        /// so that it is more suitable for emission on targets that
        /// are not themselves based on an SSA representation.
        ///
        /// If livenessMode is enabled LiveRangeStarts will be inserted into the module.
    void eliminatePhis(LivenessMode livenessMode, IRModule* module, PhiEliminationOptions options);

    void eliminatePhisInFunc(
        LivenessMode livenessMode,
        IRModule* module,
        IRGlobalValueWithCode* func,
        PhiEliminationOptions options);
}
back to top