Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pgarba/SiMBA-
Browse files Browse the repository at this point in the history
  • Loading branch information
adam committed Aug 2, 2024
2 parents 5cdb384 + 3d145b6 commit ec4083b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CSiMBA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void SimplifyLLVMModule() {
outs() << "[+] Loading LLVM Module: '" << StrIR << "'\n";

LSiMBA::LLVMParser Parser(StrIR, Output, RunParallel, UseFastCheck,
RunOptimizer, RunOptimizer, Debug, ProveZ3);
false, RunOptimizer, Debug, ProveZ3);

auto start = high_resolution_clock::now();

Expand Down
6 changes: 2 additions & 4 deletions LLVMParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ int LLVMParser::extractAndSimplify() {
}

// Optimize if any replacements
if (MBASimplified && this->OptimizeBefore) {
if (MBASimplified && this->OptimizeAfter) {
this->runLLVMOptimizer();
}

Expand Down Expand Up @@ -1075,8 +1075,6 @@ bool LLVMParser::walkSubAST(llvm::DominatorTree *DT,
C.Candidate = BinOp;

this->getAST(DT, BinOp, C.AST, C.Variables, true);

// Set Size
C.ASTSize = getASTSize(C.AST);

if (C.ASTSize < MinASTSize)
Expand Down Expand Up @@ -1561,7 +1559,7 @@ llvm::Constant *LLVMParser::getConstantInt(llvm::Type *Ty, uint64_t Value) {
return C;
}

llvm::Constant *LLVMParser::getConstantInt(llvm::Type *Ty, APInt &Value) {
llvm::Constant *LLVMParser::getConstantInt(llvm::Type *Ty, APInt Value) {
auto C = llvm::ConstantInt::get(Ty, Value);
return C;
}
Expand Down
6 changes: 3 additions & 3 deletions LLVMParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class LLVMParser {
Thread safe
*/
llvm::Constant *getConstantInt(llvm::Type *Ty, uint64_t Value);
llvm::Constant *getConstantInt(llvm::Type *Ty, llvm::APInt &Value);
llvm::Constant *getConstantInt(llvm::Type *Ty, llvm::APInt Value);

bool doesDominateInst(llvm::DominatorTree *DT, const llvm::Instruction *InstA,
const llvm::Instruction *InstB);
Expand All @@ -199,7 +199,7 @@ class LLVMParser {
llvm::SmallVectorImpl<llvm::Value *> &Variables,
std::map<std::string, z3::expr *> &VarMap, int OverrideBitWidth = 0);

z3::expr LLVMParser::boolToBV(z3::context &Z3Ctx, z3::expr &BoolExpr,
z3::expr boolToBV(z3::context &Z3Ctx, z3::expr &BoolExpr,
int BitWidth);

z3::expr *getZ3Val(z3::context &Z3Ctx, llvm::Value *V,
Expand All @@ -213,4 +213,4 @@ class LLVMParser {

} // namespace LSiMBA

#endif // LLVMPARSER_H
#endif // LLVMPARSER_H

0 comments on commit ec4083b

Please sign in to comment.