summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-dce.h
blob: 007905486e2ccdc27ed54a759eb54ef962b935f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// slang-ir-dce.h
#pragma once

namespace Slang
{
    struct IRModule;

    struct IRDeadCodeEliminationOptions
    {
        bool keepExportsAlive = false;
        bool keepLayoutsAlive = false;
    };

        /// Eliminate "dead" code from the given IR module.
        ///
        /// This pass is primarily designed for flow-insensitive
        /// "global" dead code elimination (DCE), such as removing
        /// types that are unused, functions that are never called,
        /// etc.
        ///
    void eliminateDeadCode(
        IRModule*                           module,
        IRDeadCodeEliminationOptions const& options = IRDeadCodeEliminationOptions());
}