Skip to content

Commit 071a927

Browse files
removing parallelisation around triplet generation
1 parent be3f76e commit 071a927

File tree

8 files changed

+1582
-6023
lines changed

8 files changed

+1582
-6023
lines changed

src/CollectIR.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ using namespace llvm;
1818

1919
void CollectIR::generateTriplets(std::ostream &out) {
2020
for (Function &F : M)
21-
for (BasicBlock &B : F) {
22-
res += traverseBasicBlock(B);
23-
}
21+
for (BasicBlock &B : F)
22+
traverseBasicBlock(B);
2423
out << res;
2524
}
2625

27-
std::string CollectIR::traverseBasicBlock(BasicBlock &B) {
28-
std::string local_res = "";
26+
void CollectIR::traverseBasicBlock(BasicBlock &B) {
2927
for (Instruction &I : B) {
30-
local_res += "\n" + std::string(I.getOpcodeName()) + " ";
28+
res += "\n" + std::string(I.getOpcodeName()) + " ";
3129
auto type = I.getType();
3230
IR2VEC_DEBUG(I.print(outs()); outs() << "\n";);
3331
IR2VEC_DEBUG(I.getType()->print(outs()); outs() << " Type\n";);
@@ -61,7 +59,7 @@ std::string CollectIR::traverseBasicBlock(BasicBlock &B) {
6159
} else {
6260
stype = " unknownTy ";
6361
}
64-
local_res += stype;
62+
res += stype;
6563

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

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

7371
if (isa<Function>(I.getOperand(i))) {
74-
local_res += " function ";
72+
res += " function ";
7573
IR2VEC_DEBUG(outs() << "Function\n");
7674
} else if (isa<PointerType>(I.getOperand(i)->getType())) {
77-
local_res += " pointer ";
75+
res += " pointer ";
7876
IR2VEC_DEBUG(outs() << "pointer\n");
7977
} else if (isa<Constant>(I.getOperand(i))) {
80-
local_res += " constant ";
78+
res += " constant ";
8179
IR2VEC_DEBUG(outs() << "constant\n");
8280
} else if (isa<BasicBlock>(I.getOperand(i))) {
83-
local_res += " label ";
81+
res += " label ";
8482
IR2VEC_DEBUG(outs() << "label\n");
8583
} else {
86-
local_res += " variable ";
84+
res += " variable ";
8785
IR2VEC_DEBUG(outs() << "variable2\n");
8886
}
8987
}
9088
}
91-
return local_res;
9289
}

src/include/CollectIR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CollectIR {
2121
std::string res;
2222
llvm::Module &M;
2323

24-
std::string traverseBasicBlock(llvm::BasicBlock &B);
24+
void traverseBasicBlock(llvm::BasicBlock &B);
2525

2626
public:
2727
CollectIR(std::unique_ptr<llvm::Module> &M) : M{*M} { res = ""; }

src/test-suite/gmon.out

64 Bytes
Binary file not shown.

src/test-suite/oracle/FA_llvm17_f/ir2vec.txt

Lines changed: 0 additions & 2219 deletions
Large diffs are not rendered by default.

src/test-suite/oracle/SYM_llvm17_f/ir2vec.txt

Lines changed: 1366 additions & 3585 deletions
Large diffs are not rendered by default.

src/test-suite/oracle/SYM_llvm17_onDemand/ir2vec.txt

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

src/test-suite/oracle/SYM_llvm17_p/ir2vec.txt

Lines changed: 77 additions & 77 deletions
Large diffs are not rendered by default.

src/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ std::string IR2Vec::updatedRes(IR2Vec::Vector tmp, llvm::Function *f,
9292
}
9393
res += std::to_string(i) + "\t";
9494
}
95-
res += "\n";
95+
9696
return res;
9797
}

0 commit comments

Comments
 (0)