http://llvm.org/docs/LangRef.html#i_inttoptr The 'inttoptr' instruction takes an integer<http://llvm.org/docs/LangRef.html#t_integer> value to cast, and a type to cast it to, which must be a pointer<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? Micah -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121010/a5ff2319/attachment.html>
Hi Micah, We need to fix the documentation here. We want to be able to convert vectors of integers to vectors of pointers and back. There are a few tests such as (/InstCombine/vector_gep1.ll) that check for these conversions. Nadav On Oct 10, 2012, at 11:11 AM, "Villmow, Micah" <Micah.Villmow at amd.com> wrote:> http://llvm.org/docs/LangRef.html#i_inttoptr > > The 'inttoptr' instruction takes an integer value to cast, and a type to cast it to, which must be a 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? > > Micah > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121010/03950531/attachment.html>
Yes I know, I'm having problems with these tests because they violate the documentation. :) Micah From: Nadav Rotem [mailto:nrotem at apple.com] Sent: Wednesday, October 10, 2012 11:52 AM To: Villmow, Micah Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Inconsistency in the LLVM docs Hi Micah, We need to fix the documentation here. We want to be able to convert vectors of integers to vectors of pointers and back. There are a few tests such as (/InstCombine/vector_gep1.ll) that check for these conversions. Nadav On Oct 10, 2012, at 11:11 AM, "Villmow, Micah" <Micah.Villmow at amd.com<mailto:Micah.Villmow at amd.com>> wrote: http://llvm.org/docs/LangRef.html#i_inttoptr The 'inttoptr' instruction takes an integer<http://llvm.org/docs/LangRef.html#t_integer> value to cast, and a type to cast it to, which must be a pointer<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? Micah _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121010/af1fa3f0/attachment.html>
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. Nick