I encountered the error "KLEE: ERROR: unknown intrinsic: llvm.objectsize.i64.p0i8" when running KLEE on a program.
I know that I should add support for it in the IntrinsicCleaner pass. But I failed to find the documentation for this intrinsic function. Does anybody know the purpose of this intrinsic function?
Below is the line of LLCM code that involves the function:
%6 = call i64 @llvm.objectsize.i64.p0i8(i8* %5, i1 false)
It's right in the LLVM documentation:
declare i64 @llvm.objectsize.i64(i8* <object>, i1 <min>)
The llvm.objectsize intrinsic is designed to provide information to the optimizers to determine at compile time whether a) an operation (like memcpy) will overflow a buffer that corresponds to an object, or b) that a runtime check for overflow isn’t necessary. An object in this context means an allocation of a specific class, structure, array, or other object.