[LLVMdev] Small problem with intrinsics

Bart Coppens Bart.Coppens at elis.ugent.be
Mon Apr 21 10:00:22 PDT 2008

Hi Nicolas,

> I guess that's because the value of the last argument of llvm.memcpy has
> to be known at compile time.
Hmmm ok, that's understandable, but it's also a bit of a problem for me. I am 
writing a pass that creates a 'shadow' copy of each function, so that I can 
do some bookkeeping with it, and then call the original function afterwards. 
This would include intrinsics like memcpy.

Now, would it be possible to programmatically determine which arguments are 
required to be constants? Then I would be able to partially evaluate my 
custom function, so that multiple versions would be emitted, each with the 
right constants in their call to memcpy.

(Given that LLVM seems to be pretty statically typed, it's rather confusing 
that this kind of restriction isn't at least annotated in the user-visible 
type, or isn't noticed by llvm-as.)

Bart Coppens

More information about the llvm-dev mailing list