summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-strip-legalization-insts.h
blob: 0e588311813c111e0b0414d3e1ebd91dac0ad606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// slang-ir-strip-legalization-insts.h
#pragma once

namespace Slang
{

struct IRModule;

/// Removes global instructions from the module that are only required for legalization.
/// These instructions are safe to or must be removed for instruction emitting.
///
/// Currently does the following:
/// - Removes specialization dictionaries.
/// - Removes the contents of all witness table instructions.
/// - Removes global param entry point decorations, as they will cause false code-gen circularity
///   alerts during pre-emit actions.
///
void stripLegalizationOnlyInstructions(IRModule* module);

/// Remove [KeepAlive] decorations from witness tables.
void unpinWitnessTables(IRModule* module);

} // namespace Slang