[LLVMdev] Does llvm intrinsic function allow "complicated" arguments?

kewuzhang kewu.zhang at amd.com
Fri Mar 27 08:15:15 PDT 2015


Thank you Tom, 

Sorry for the errors, obviously I made that example wrong.
Here is the one with little bit name changes:
>  call float @ir.sample_image(%struct.image_t addrspace(1)* %tex_unit0, %struct.sampler_t addrspace(2)* inttoptr (i64 -9223372036854542193 to %struct.sampler_t addrspace(2)*), i32 1, <2 x float> %62, float %61) 

"%struct.sampler_t addrspace(2)* inttoptr (i64 -9223372036854542193 to %struct.sampler_t addrspace(2)*)” is the part give me problem, I got “constant “ for getOperand(3) call.

best

kevin

> On 27 March 2015 at 07:22, kewuzhang <kewu.zhang at amd.com> wrote:
>>    int bitcast (i16  337203 to i32)
> 
>> I think something is messed up,  but the getOperand(i) is llvm core function. So I suspect the above intrinsic call is legal or not?
> 
> Bitcast only works between types of the same size. You shouldn't even
> have been able to create that expression. It's strongly recommended
> that you use a build of LLVM with assertions enabled for development,
> are you doing that?
> 
> Either way, for i16 -> i32, your options are "zext" or "sext".
> 
> Cheers.
> 
> Tim.





More information about the llvm-dev mailing list