;
16using namespacethreadSafety;
40 case BOP_Eq:
return "==";
51SExpr* Future::force() {
59 unsignedIdx = Predecessors.
size();
62 for(
auto*
E: Args) {
63 if(
auto*Ph = dyn_cast<Phi>(
E)) {
64Ph->values().reserveCheck(1, Arena);
65Ph->values().push_back(
nullptr);
72Predecessors.
reserve(NumPreds, Arena);
73 for(
auto*
E: Args) {
74 if(
auto*Ph = dyn_cast<Phi>(
E)) {
75Ph->values().reserve(NumPreds, Arena);
84 if(
const auto*
V= dyn_cast<Variable>(
E)) {
90 if(
const auto*Ph = dyn_cast<Phi>(
E)) {
106 if(
auto*
V= dyn_cast<Variable>(
E)) {
112 E=
V->definition();
117 if(
auto*Ph = dyn_cast<Phi>(
E)) {
140 for(
unsignedi = 1, n = Ph->
values().
size(); i < n; ++i) {
152unsignedBasicBlock::renumberInstrs(
unsignedID) {
153 for(
auto*Arg : Args)
154Arg->setID(
this, ID++);
155 for(
auto*Instr : Instrs)
156Instr->setID(
this, ID++);
157TermInstr->
setID(
this, ID++);
167 if(Visited)
returnID;
170ID =
Block->topologicalSort(Blocks, ID);
175Blocks[BlockID] =
this;
193 if(!Visited)
returnID;
195 if(DominatorNode.
Parent)
196ID = DominatorNode.
Parent->topologicalFinalSort(Blocks, ID);
197 for(
auto*Pred : Predecessors)
198ID = Pred->topologicalFinalSort(Blocks, ID);
199assert(
static_cast<size_t>(ID) < Blocks.
size());
201Blocks[BlockID] =
this;
208voidBasicBlock::computeDominator() {
211 for(
auto*Pred : Predecessors) {
213 if(Pred->BlockID >= BlockID)
continue;
215 if(Candidate ==
nullptr) {
220 auto*Alternate = Pred;
221 while(Alternate != Candidate) {
222 if(Candidate->BlockID > Alternate->BlockID)
223Candidate = Candidate->DominatorNode.
Parent;
225Alternate = Alternate->DominatorNode.
Parent;
228DominatorNode.
Parent= Candidate;
235voidBasicBlock::computePostDominator() {
240 if(Succ->BlockID <= BlockID)
continue;
242 if(Candidate ==
nullptr) {
247 auto*Alternate = Succ;
248 while(Alternate != Candidate) {
249 if(Candidate->BlockID < Alternate->BlockID)
250Candidate = Candidate->PostDominatorNode.
Parent;
252Alternate = Alternate->PostDominatorNode.
Parent;
255PostDominatorNode.
Parent= Candidate;
260voidSCFG::renumberInstrs() {
261 unsignedInstrID = 0;
262 for(
auto*
Block: Blocks)
263InstrID =
Block->renumberInstrs(InstrID);
272N->
NodeID=
P->SizeOfSubTree;
292 unsignedNumUnreachableBlocks = Entry->topologicalSort(Blocks, Blocks.size());
293 if(NumUnreachableBlocks > 0) {
295 for(
unsignedI = NumUnreachableBlocks,
E= Blocks.size(); I <
E; ++I) {
296 unsignedNI = I - NumUnreachableBlocks;
297Blocks[NI] = Blocks[I];
298Blocks[NI]->BlockID = NI;
301Blocks.drop(NumUnreachableBlocks);
305 for(
auto*
Block: Blocks)
306 Block->computeDominator();
309 unsignedNumBlocks = Exit->topologicalFinalSort(Blocks, 0);
310assert(
static_cast<size_t>(NumBlocks) == Blocks.size());
318 for(
auto*
Block: Blocks.reverse()) {
319 Block->computePostDominator();
324 for(
auto*
Block: Blocks) {
329 for(
auto*
Block: Blocks.reverse()) {
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static void computeNodeSize(BasicBlock *B, BasicBlock::TopologyNode BasicBlock::*TN)
static void computeNodeID(BasicBlock *B, BasicBlock::TopologyNode BasicBlock::*TN)
A basic block is part of an SCFG.
unsigned addPredecessor(BasicBlock *Pred)
ArrayRef< BasicBlock * > successors()
void reservePredecessors(unsigned NumPreds)
virtual SExpr * compute()
Phi Node, for code in SSA form.
const ValArray & values() const
Base class for AST nodes in the typed intermediate language.
void setID(BasicBlock *B, unsigned id)
Set the basic block and instruction ID for this expression.
void reserve(size_t Ncp, MemRegionRef A)
void push_back(const T &Elem)
void reserveCheck(size_t N, MemRegionRef A)
bool isTrivial(const SExpr *E)
TIL_UnaryOpcode
Opcode for unary arithmetic operations.
void simplifyIncompleteArg(til::Phi *Ph)
StringRef getBinaryOpcodeString(TIL_BinaryOpcode Op)
Return the name of a binary opcode.
StringRef getUnaryOpcodeString(TIL_UnaryOpcode Op)
Return the name of a unary opcode.
TIL_BinaryOpcode
Opcode for binary arithmetic operations.
SExpr * simplifyToCanonicalVal(SExpr *E)
const SExpr * getCanonicalVal(const SExpr *E)
The JSON file list parser is used to communicate input to InstallAPI.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4