summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-ssa-register-allocate.h
blob: 25566f51f42e9d6305d88762c1fba59db62d4c80 (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
25
26
27
// slang-ir-ssa-register-allocate.h
#pragma once

#include "slang-ir.h"

namespace Slang
{
struct IRDominatorTree;

struct RegisterInfo : RefObject
{
    IRType* type;
    List<IRInst*> insts;
};

struct RegisterAllocationResult
{
    OrderedDictionary<IRType*, List<RefPtr<RegisterInfo>>> mapTypeToRegisterList;
    Dictionary<IRInst*, RefPtr<RegisterInfo>> mapInstToRegister;
};

RegisterAllocationResult allocateRegistersForFunc(
    IRGlobalValueWithCode* func,
    RefPtr<IRDominatorTree>& inOutDom,
    bool allocateForCompositeTypesOnly);

} // namespace Slang