Currently, FnCall::toSMT only supports allocsize(0) and allockind for functions returning ptr.
If a function returns { ptr, i64 }, Alive2 triggers the following assertion.
Related testcase
Transforms/InstCombine/simplify-libcalls-new.ll
https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=c3466a6048874dbf&test=Transforms%2FInstCombine%2Fsimplify-libcalls-new.ll
Minimal reproducer
define void @src() {
%call3 = call {ptr, i64} @__size_returning_new(i64 10) #0
ret void
}
define void @tgt() {
%call3 = call {ptr, i64} @__size_returning_new(i64 10) #0
ret void
}
declare { ptr, i64 } @__size_returning_new(i64)
attributes #0 = { allocsize(0) }
Error
Assertion failed: (getType().isPtrType()), function toSMT, file instr.cpp, line 2821.
Currently,
FnCall::toSMTonly supportsallocsize(0)andallockindfor functions returning ptr.If a function returns
{ ptr, i64 }, Alive2 triggers the following assertion.Related testcase
Transforms/InstCombine/simplify-libcalls-new.llhttps://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=c3466a6048874dbf&test=Transforms%2FInstCombine%2Fsimplify-libcalls-new.ll
Minimal reproducer
Error