1

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)

Dingbao Xie
  • 716
  • 9
  • 21

2 Answers2

1

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.

Marco A.
  • 43,032
  • 26
  • 132
  • 246
0

I'll extend Marco's answer to address Dingbao's question. 'p0' denotes a pointer into address space 0; 'i8' indicates an 8-bit integer. See the LLLVM language reference.

mcoblenz
  • 1
  • 3