[LLVMdev] More info, was Help needed after hiatus

Chris Lattner sabre at nondot.org
Sat May 17 21:18:56 PDT 2008


On May 17, 2008, at 1:57 PM, Eli Friedman wrote:
> On Sat, May 17, 2008 at 11:34 AM, Richard Pennington <rich at pennware.com 
> > wrote:
>> If I run the optimizer (opt) on this code snippet with -std-compile- 
>> opts
>> the optimizer hangs.

wow, that's not polite :)

>>
> BTW, It's usually better to file a bug for this sort of thing.

Absolutely.  In any case, this is fixed, patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080512/062585.html

Thanks for letting us know about this!

> A side note: I know I've seen suggestions that "ptrtoint (i32*
> getelementptr (i32* null, i32 1) to i32)" is a suitable replacement
> for sizeof, but if it is supposed to be legal, the documentation for
> getelementptr should make that clear. I'm pretty sure the equivalent
> C, "((int*)0)+1", has undefined behavior.

Is there a great need to do this?  It is useful to have a page that  
explains useful idioms, but there is something to be said for keeping  
langref.html relatively focused on defining semantics, not giving lots  
of examples of use.  If the wording around GEP can be improved, to  
make it more clear that restrictions on C don't apply, then we should  
definitely improve the wording of course.

-Chris



More information about the llvm-dev mailing list