llvm2alive: dont store arguments for 'unknown known' functions
useless information as in the end they simply produce invalid exprs
MODIFY
llvm_util/known_fns.cpp
llvm_util/known_fns.cpp
@@ -25,7 +25,7 @@ known_call(llvm::CallInst &i, const llvm::TargetLibraryInfo &TLI,
BasicBlock &BB, const vector<Value*> &args) {
auto ty = llvm_type2alive(i.getType());
if (!ty)
- RETURN_FAIL_KNOWN();
+ RETURN_FAIL_UNKNOWN();
// TODO: add support for checking mismatch of C vs C++ alloc fns
if (llvm::isMallocLikeFn(&i, &TLI, false)) {

MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -286,6 +286,10 @@ public:
!known);
unique_ptr<Instr> ret_val;
+ // avoid parsing arguments altogether for "unknown known" functions
+ if (known)
+ goto end;
+
for (uint64_t argidx = 0, nargs = i.arg_size(); argidx < nargs; ++argidx) {
auto *arg = args[argidx];
ParamAttrs attr;
@@ -339,6 +343,7 @@ public:
BB->addInstr(move(call));
RETURN_IDENTIFIER(move(ret_val));
}
+end:
RETURN_IDENTIFIER(move(call));
}

llvm2alive: dont store arguments for 'unknown known' functions
useless information as in the end they simply produce invalid exprs