Siddharth Bhat via llvm-dev
2017-Aug-11 20:40 UTC
[llvm-dev] Converting i32** to [4 x i32]* ?
Hello all, This is a general question regarding type conversion: from: <ty>** to: [<size> x <ty>]*>From what I understand, bitcast is wrong in this case because a GEP into a<ty>** should be computed differently from a GEP into [<size> x <ty>]*. So, what is the correct way to perform this type conversion? Thanks, Siddharth -- Sending this from my phone, please excuse any typos! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170811/528d0ee6/attachment.html>
Krzysztof Parzyszek via llvm-dev
2017-Aug-11 21:47 UTC
[llvm-dev] Converting i32** to [4 x i32]* ?
On 8/11/2017 3:40 PM, Siddharth Bhat via llvm-dev wrote:> > This is a general question regarding type conversion: > > from: <ty>** > to: [<size> x <ty>]* > > From what I understand, bitcast is wrong in this case because a GEP > into a <ty>** should be computed differently from a GEP into [<size> x > <ty>]*. > > So, what is the correct way to perform this type conversion?Bitcast, then use the correct form of GEP and other affected instructions. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Siddharth Bhat via llvm-dev
2017-Aug-12 11:13 UTC
[llvm-dev] Converting i32** to [4 x i32]* ?
What would the "correct form of GEP be"? Thanks, Siddharth On Fri 11 Aug, 2017, 23:47 Krzysztof Parzyszek via llvm-dev, < llvm-dev at lists.llvm.org> wrote:> On 8/11/2017 3:40 PM, Siddharth Bhat via llvm-dev wrote: > > > > This is a general question regarding type conversion: > > > > from: <ty>** > > to: [<size> x <ty>]* > > > > From what I understand, bitcast is wrong in this case because a GEP > > into a <ty>** should be computed differently from a GEP into [<size> x > > <ty>]*. > > > > So, what is the correct way to perform this type conversion? > > Bitcast, then use the correct form of GEP and other affected instructions. > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > hosted by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Sending this from my phone, please excuse any typos! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170812/44d84fc3/attachment.html>