<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 17, 2011, at 5:02 AM, Matthieu Monrocq wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">My surprise stems from the fact that Clang/LLVM seems to reserve (at least in its bytecode) space for all temporary variables, not taking into account that some are mutually exclusive. I would have expected the space to be<span class="Apple-converted-space"> </span><i>folded</i>. However, since this is LLVM IR, and not the final assembly, and since LLVM IR is strongly typed, it makes sense to keep them separated.<br><br>Therefore I was wondering if in the x86 representation (say) these<span class="Apple-converted-space"> </span><i>would</i><span class="Apple-converted-space"> </span>be folded, and if so what is the name of the Optimization/CodeGen pass responsible ?<br></span></blockquote><div><br></div><div>I commented on stack overflow.  The rough plan of record is captured here:</div><div><a href="http://nondot.org/sabre/LLVMNotes/MemoryUseMarkers.txt">http://nondot.org/sabre/LLVMNotes/MemoryUseMarkers.txt</a></div><div><br></div><div>The basic idea is that we capture the lifetime of the memory object in IR, then have the code generator allocate multiple alloca's with non-overlapping lifetimes to the same stack offset.</div><div><br></div><div>-Chris</div></div><br></body></html>