summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-address-analysis.h
blob: 603787b21f3f9d5109c5be8368936f238366a91b (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-address-analysis.h
#pragma once

#include "slang-ir-dominators.h"
#include "slang-ir.h"

namespace Slang
{
struct AddressInfo : public RefObject
{
    IRInst* addrInst = nullptr;
    AddressInfo* parentAddress = nullptr;
    bool isConstant = false;
    List<AddressInfo*> children;
};

struct AddressAccessInfo
{
    OrderedDictionary<IRInst*, RefPtr<AddressInfo>> addressInfos;
};

// Gather info on all addresses used by `func`.
AddressAccessInfo analyzeAddressUse(IRDominatorTree* domTree, IRGlobalValueWithCode* func);
} // namespace Slang