Skip to content

Commit

Permalink
removing parallelisation around triplet generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-sachdeva committed Jun 27, 2024
1 parent be3f76e commit 071a927
Show file tree
Hide file tree
Showing 8 changed files with 1,582 additions and 6,023 deletions.
23 changes: 10 additions & 13 deletions src/CollectIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ using namespace llvm;

void CollectIR::generateTriplets(std::ostream &out) {
for (Function &F : M)
for (BasicBlock &B : F) {
res += traverseBasicBlock(B);
}
for (BasicBlock &B : F)
traverseBasicBlock(B);
out << res;
}

std::string CollectIR::traverseBasicBlock(BasicBlock &B) {
std::string local_res = "";
void CollectIR::traverseBasicBlock(BasicBlock &B) {
for (Instruction &I : B) {
local_res += "\n" + std::string(I.getOpcodeName()) + " ";
res += "\n" + std::string(I.getOpcodeName()) + " ";
auto type = I.getType();
IR2VEC_DEBUG(I.print(outs()); outs() << "\n";);
IR2VEC_DEBUG(I.getType()->print(outs()); outs() << " Type\n";);
Expand Down Expand Up @@ -61,7 +59,7 @@ std::string CollectIR::traverseBasicBlock(BasicBlock &B) {
} else {
stype = " unknownTy ";
}
local_res += stype;
res += stype;

IR2VEC_DEBUG(errs() << "Type taken : " << stype << "\n";);

Expand All @@ -71,22 +69,21 @@ std::string CollectIR::traverseBasicBlock(BasicBlock &B) {
IR2VEC_DEBUG(I.getOperand(i)->print(outs()); outs() << "\n";);

if (isa<Function>(I.getOperand(i))) {
local_res += " function ";
res += " function ";
IR2VEC_DEBUG(outs() << "Function\n");
} else if (isa<PointerType>(I.getOperand(i)->getType())) {
local_res += " pointer ";
res += " pointer ";
IR2VEC_DEBUG(outs() << "pointer\n");
} else if (isa<Constant>(I.getOperand(i))) {
local_res += " constant ";
res += " constant ";
IR2VEC_DEBUG(outs() << "constant\n");
} else if (isa<BasicBlock>(I.getOperand(i))) {
local_res += " label ";
res += " label ";
IR2VEC_DEBUG(outs() << "label\n");
} else {
local_res += " variable ";
res += " variable ";
IR2VEC_DEBUG(outs() << "variable2\n");
}
}
}
return local_res;
}
2 changes: 1 addition & 1 deletion src/include/CollectIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CollectIR {
std::string res;
llvm::Module &M;

std::string traverseBasicBlock(llvm::BasicBlock &B);
void traverseBasicBlock(llvm::BasicBlock &B);

public:
CollectIR(std::unique_ptr<llvm::Module> &M) : M{*M} { res = ""; }
Expand Down
Binary file modified src/test-suite/gmon.out
Binary file not shown.
2,219 changes: 0 additions & 2,219 deletions src/test-suite/oracle/FA_llvm17_f/ir2vec.txt

Large diffs are not rendered by default.

4,951 changes: 1,366 additions & 3,585 deletions src/test-suite/oracle/SYM_llvm17_f/ir2vec.txt

Large diffs are not rendered by default.

254 changes: 127 additions & 127 deletions src/test-suite/oracle/SYM_llvm17_onDemand/ir2vec.txt

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions src/test-suite/oracle/SYM_llvm17_p/ir2vec.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ std::string IR2Vec::updatedRes(IR2Vec::Vector tmp, llvm::Function *f,
}
res += std::to_string(i) + "\t";
}
res += "\n";

return res;
}

0 comments on commit 071a927

Please sign in to comment.