|
37 | 37 | using namespace llvm; |
38 | 38 | using namespace IR2Vec; |
39 | 39 |
|
40 | | -// void IR2Vec_FA::getTransitiveUse( |
41 | | -// const Instruction *root, const Instruction *def, |
42 | | -// SmallVector<const Instruction *, 100> &visitedList) |
43 | | -// { |
44 | | -// std::stack<const Instruction *> stack; // Explicit stack for DFS |
45 | | -// stack.push(def); |
46 | | - |
47 | | -// while (!stack.empty()) { |
48 | | -// const Instruction *currentDef = stack.top(); |
49 | | -// stack.pop(); |
50 | | - |
51 | | -// visitedList.push_back(currentDef); |
52 | | -// unsigned operandNum = 0; |
53 | | -// for (auto U : currentDef->users()) { |
54 | | -// if (auto use = dyn_cast<Instruction>(U)) |
55 | | -// { |
56 | | -// if (std::find(visitedList.begin(), visitedList.end(), use) == |
57 | | -// visitedList.end()) |
58 | | -// { |
59 | | -// if (isMemOp(use->getOpcodeName(), operandNum, memWriteOp) && |
60 | | -// use->getOperand(operandNum) == currentDef) |
61 | | -// { |
62 | | -// writeDefsMap[root].push_back(use); |
63 | | -// } else if (isMemOp(use->getOpcodeName(), operandNum, |
64 | | -// memAccessOp) && use->getOperand(operandNum) == currentDef) { |
65 | | -// stack.push(use); // Push the next node to the stack |
66 | | -// } |
67 | | -// } |
68 | | -// } |
69 | | -// } |
70 | | -// } |
71 | | -// } |
72 | | - |
73 | 40 | void IR2Vec_FA::getTransitiveUse( |
74 | 41 | const Instruction *root, const Instruction *def, |
75 | 42 | SmallVector<const Instruction *, 100> &visitedList) { |
|
0 commit comments