https://github.com/shader-slang/slang
Raw File
Tip revision: 45c7d33fe87e1628de7991f46ca68f8ddd2f7e4c authored by Yong He on 20 March 2024, 22:47:36 UTC
Fix spirv generation for using output stream in a function. (#3806)
Tip revision: 45c7d33
slang-ir-simplify-cfg.h
// slang-ir-simplify-cfg.h
#pragma once

namespace Slang
{
    struct IRModule;
    struct IRGlobalValueWithCode;

    struct CFGSimplificationOptions
    {
        bool removeTrivialSingleIterationLoops = true;
        bool removeSideEffectFreeLoops = true;
        static CFGSimplificationOptions getDefault() { return CFGSimplificationOptions(); }
        static CFGSimplificationOptions getFast() { return CFGSimplificationOptions{ false, false }; }
    };

        /// Simplifies control flow graph by merging basic blocks that
        /// forms a simple linear chain.
        /// Returns true if changed.
    bool simplifyCFG(IRModule* module, CFGSimplificationOptions options);

    bool simplifyCFG(IRGlobalValueWithCode* func, CFGSimplificationOptions options);

}
back to top