On 08/28/2011 02:23 PM, Linus Torvalds wrote: >> On Sun, Aug 28, 2011 at 10:52 AM, Josh Triplett<josh@xxxxxxxxxxxxxxxx> >> wrote: >>>> >>>> You should consider all types to be just "blocks of memory", and >>>> sparse has already calculated all offsets etc for you. As far as LLVM >>>> is concerned, the memory has no structure, it's just a blob. >>> >>> I suspect LLVM's optimization passes won't particularly care for that >>> approach. >> >> That's fine. We've already done the CSE and alias analysis on the >> thing. And as mentioned, trying to turn overlapping (or partial) >> accesses into some "named accesses" is just *wrong*. They weren't >> named in the C code either. They are accesses through pointer >> arithmetic. Trying to make them be somehow named would just be crazy. On Sun, Aug 28, 2011 at 10:33 PM, Jeff Garzik <jeff@xxxxxxxxxx> wrote: > LLVM just cares about layout. > > It does not care about naming (or lack thereof). Nobody/nothing is trying > to make them named. Yup. The LLVM backend pretty much expects to know about struct layout. For example, this simple initialization: struct symbol { char *s; }; extern struct symbol foo; struct symbol *foo_p = &foo; Looks like this in LLVM bitcode: %struct.symbol = type { i8* } @foo = external global %struct.symbol @foo_p = global %struct.symbol* @foo, align 8 I'm sure we *could* turn treat 'foo' as simple block of memory and turn 'foo_p' into an untyped pointer. However, it's likely to be more difficult than to just let LLVM know about struct layouts. Pekka -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html