mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Swift Optimizer: add the dominator and post-dominator tree analysis
This commit is contained in:
@@ -36,6 +36,10 @@ public:
|
||||
DominanceAnalysis(const DominanceAnalysis &) = delete;
|
||||
DominanceAnalysis &operator=(const DominanceAnalysis &) = delete;
|
||||
|
||||
static SILAnalysisKind getAnalysisKind() {
|
||||
return SILAnalysisKind::Dominance;
|
||||
}
|
||||
|
||||
static bool classof(const SILAnalysis *S) {
|
||||
return S->getKind() == SILAnalysisKind::Dominance;
|
||||
}
|
||||
@@ -65,6 +69,10 @@ public:
|
||||
PostDominanceAnalysis(const PostDominanceAnalysis &) = delete;
|
||||
PostDominanceAnalysis &operator=(const PostDominanceAnalysis &) = delete;
|
||||
|
||||
static SILAnalysisKind getAnalysisKind() {
|
||||
return SILAnalysisKind::PostDominance;
|
||||
}
|
||||
|
||||
static bool classof(const SILAnalysis *S) {
|
||||
return S->getKind() == SILAnalysisKind::PostDominance;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,14 @@ typedef struct {
|
||||
void * _Nullable dea;
|
||||
} BridgedDeadEndBlocksAnalysis;
|
||||
|
||||
typedef struct {
|
||||
void * _Nullable dt;
|
||||
} BridgedDomTree;
|
||||
|
||||
typedef struct {
|
||||
void * _Nullable pdt;
|
||||
} BridgedPostDomTree;
|
||||
|
||||
typedef struct {
|
||||
void * _Nonnull opaquePtr;
|
||||
unsigned char kind;
|
||||
@@ -92,6 +100,18 @@ PassContext_getDeadEndBlocksAnalysis(BridgedPassContext context);
|
||||
SwiftInt DeadEndBlocksAnalysis_isDeadEnd(BridgedDeadEndBlocksAnalysis debAnalysis,
|
||||
BridgedBasicBlock);
|
||||
|
||||
BridgedDomTree PassContext_getDomTree(BridgedPassContext context);
|
||||
|
||||
SwiftInt DominatorTree_dominates(BridgedDomTree domTree,
|
||||
BridgedBasicBlock dominating,
|
||||
BridgedBasicBlock dominated);
|
||||
|
||||
BridgedPostDomTree PassContext_getPostDomTree(BridgedPassContext context);
|
||||
|
||||
SwiftInt PostDominatorTree_postDominates(BridgedPostDomTree pdomTree,
|
||||
BridgedBasicBlock dominating,
|
||||
BridgedBasicBlock dominated);
|
||||
|
||||
BridgedSlab PassContext_getNextSlab(BridgedSlab slab);
|
||||
BridgedSlab PassContext_getPreviousSlab(BridgedSlab slab);
|
||||
BridgedSlab PassContext_allocSlab(BridgedPassContext passContext,
|
||||
|
||||
Reference in New Issue
Block a user