https://github.com/shader-slang/slang
Raw File
Tip revision: 89c1fd0dd1581221f583653a9dfa6d1cf990577c authored by Yong He on 03 June 2024, 21:12:48 UTC
Fix performance issue in source-map (#4261)
Tip revision: 89c1fd0
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