So I gather this means that malloc was removed from the IR because there are platforms that don't have non-stack allocation semantics? Garrison On Dec 7, 2009, at 12:21, Chris Lattner wrote:> > On Dec 7, 2009, at 8:45 AM, Garrison Venn wrote: > >> Ouch! Didn't see that. So at the risk of irritating those still in the process of baking 2.7, what is the sanction way of doing heap allocation going forward? :-) > > No, we only support stack allocation in LLVM IR now. :-) > > You can call out to normal malloc and free, just like any external function. > > -Chris > >> >> Garrison >> >> On Dec 7, 2009, at 11:18, Chris Lattner wrote: >> >>> >>> On Dec 7, 2009, at 2:13 AM, Florian Merz wrote: >>> >>>> Hi everyone, >>>> >>>> I noticed that MallocInst and FreeInst have been removed from the LLVM IR as >>>> well as the language reference[1]. May I propose that at least some >>>> placeholder is left in that document telling the reader that these >>>> instructions have been removed. This should be kept in at least until there is >>>> one official release that does not support these instructions anymore. >>>> The same goes for the addition of the indirect branch instruction. A note in >>>> the language reference would be nice telling the reader when this instruction >>>> has been added to the language. >>> >>> Hi Florian, >>> >>> The documentation for LLVM is intended to describe the state of the system without a historical view. To get the historical view we put major changes in the release notes. These haven't been written yet for 2.7 though. >>> >>> -Chris >>> >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >
On Dec 7, 2009, at 9:49 AM, Garrison Venn wrote:> So I gather this means that malloc was removed from the IR because > there are platforms that don't have non-stack allocation semantics?No, it was removed because it wasn't necessary, and the malloc 'instruction' didn't support 64-bit targets. -Chris> > Garrison > > On Dec 7, 2009, at 12:21, Chris Lattner wrote: > >> >> On Dec 7, 2009, at 8:45 AM, Garrison Venn wrote: >> >>> Ouch! Didn't see that. So at the risk of irritating those still in >>> the process of baking 2.7, what is the sanction way of doing heap >>> allocation going forward? :-) >> >> No, we only support stack allocation in LLVM IR now. :-) >> >> You can call out to normal malloc and free, just like any external >> function. >> >> -Chris >> >>> >>> Garrison >>> >>> On Dec 7, 2009, at 11:18, Chris Lattner wrote: >>> >>>> >>>> On Dec 7, 2009, at 2:13 AM, Florian Merz wrote: >>>> >>>>> Hi everyone, >>>>> >>>>> I noticed that MallocInst and FreeInst have been removed from >>>>> the LLVM IR as >>>>> well as the language reference[1]. May I propose that at least >>>>> some >>>>> placeholder is left in that document telling the reader that these >>>>> instructions have been removed. This should be kept in at least >>>>> until there is >>>>> one official release that does not support these instructions >>>>> anymore. >>>>> The same goes for the addition of the indirect branch >>>>> instruction. A note in >>>>> the language reference would be nice telling the reader when >>>>> this instruction >>>>> has been added to the language. >>>> >>>> Hi Florian, >>>> >>>> The documentation for LLVM is intended to describe the state of >>>> the system without a historical view. To get the historical view >>>> we put major changes in the release notes. These haven't been >>>> written yet for 2.7 though. >>>> >>>> -Chris >>>> >>>> >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Ah, thanks. The motivational reasons help my understanding. Garrison On Dec 7, 2009, at 12:55, Chris Lattner wrote:> > On Dec 7, 2009, at 9:49 AM, Garrison Venn wrote: > >> So I gather this means that malloc was removed from the IR because there are platforms that don't have non-stack allocation semantics? > > No, it was removed because it wasn't necessary, and the malloc 'instruction' didn't support 64-bit targets. > > -Chris > >> >> Garrison >> >> On Dec 7, 2009, at 12:21, Chris Lattner wrote: >> >>> >>> On Dec 7, 2009, at 8:45 AM, Garrison Venn wrote: >>> >>>> Ouch! Didn't see that. So at the risk of irritating those still in the process of baking 2.7, what is the sanction way of doing heap allocation going forward? :-) >>> >>> No, we only support stack allocation in LLVM IR now. :-) >>> >>> You can call out to normal malloc and free, just like any external function. >>> >>> -Chris >>> >>>> >>>> Garrison >>>> >>>> On Dec 7, 2009, at 11:18, Chris Lattner wrote: >>>> >>>>> >>>>> On Dec 7, 2009, at 2:13 AM, Florian Merz wrote: >>>>> >>>>>> Hi everyone, >>>>>> >>>>>> I noticed that MallocInst and FreeInst have been removed from the LLVM IR as >>>>>> well as the language reference[1]. May I propose that at least some >>>>>> placeholder is left in that document telling the reader that these >>>>>> instructions have been removed. This should be kept in at least until there is >>>>>> one official release that does not support these instructions anymore. >>>>>> The same goes for the addition of the indirect branch instruction. A note in >>>>>> the language reference would be nice telling the reader when this instruction >>>>>> has been added to the language. >>>>> >>>>> Hi Florian, >>>>> >>>>> The documentation for LLVM is intended to describe the state of the system without a historical view. To get the historical view we put major changes in the release notes. These haven't been written yet for 2.7 though. >>>>> >>>>> -Chris >>>>> >>>>> >>>>> _______________________________________________ >>>>> LLVM Developers mailing list >>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>> >>> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
On Monday 07 December 2009 17:55:44 Chris Lattner wrote:> On Dec 7, 2009, at 9:49 AM, Garrison Venn wrote: > > So I gather this means that malloc was removed from the IR because > > there are platforms that don't have non-stack allocation semantics? > > No, it was removed because it wasn't necessary, and the malloc > 'instruction' didn't support 64-bit targets.BTW, what is the state of having to index into structs using i32 and not i64 even on a 64-bit platform? Is that due to be changed as well or is there some reason for requiring an i32? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e