[LLVMdev] Inconsistency in the LLVM docs

Nick Lewycky nicholas at mxc.ca
Wed Oct 10 12:50:59 PDT 2012

Villmow, Micah wrote:
> http://llvm.org/docs/LangRef.html#i_inttoptr
> The 'inttoptr' instruction takes aninteger
> <http://llvm.org/docs/LangRef.html#t_integer>value to cast, and a type
> to cast it to, which must be apointer
> <http://llvm.org/docs/LangRef.html#t_pointer>type.
> The final example is:
> %Z = inttoptr <4 x i32> %G to <4 x i8*>/; yields truncation of vector G
> to four pointers/
> The result is not a pointer type, but a vector of pointer types. This
> violates the restriction of the arguments.
> Is this an overview, or should this instruction type be illegal?

I think this is intended to be legal. Have you checked the verifier (I 
haven't)? There might be a few places left in LangRef where 'integer', 
'pointer' or 'float' should read template<typename T>'T or vector of 
Ts', if you're interested in auditing it.


More information about the llvm-dev mailing list