-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimplifyCFG.h
More file actions
30 lines (25 loc) · 842 Bytes
/
Copy pathSimplifyCFG.h
File metadata and controls
30 lines (25 loc) · 842 Bytes
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
28
29
30
// control-flow simplification: fold branches on constant predicates, collapse
// single-predecessor regions and their phis, and prune unreachable control
//
// references:
// - C. Click and M. Paleczny, "A Simple Graph-Based Intermediate
// Representation", ACM SIGPLAN Workshop on IRs, 1995
// - C. Click, "Combining Analyses, Combining Optimizations", PhD thesis,
// Rice University, 1995
#ifndef RAT_PASS_OPT_SIMPLIFYCFG_H
#define RAT_PASS_OPT_SIMPLIFYCFG_H
#include "Core.h"
#include "IR/Opcode.h"
#include "Pass/Pass.h"
namespace rat {
struct Function;
struct Node;
struct SimplifyCFGPass : FunctionPass {
const C8* name() const override;
U32 runOnFunction(Function& fn) override;
private:
Set<Node*> reachableControl(Function& fn);
List<Node*> nodesOfOpcode(Function& fn, Opcode op);
};
} // namespace rat
#endif