<br><br><div class="gmail_quote">2011/8/17 Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Aug 17, 2011, at 5:02 AM, Matthieu Monrocq wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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> </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> </span><i>would</i><span> </span>be folded, and if so what is the name of the Optimization/CodeGen pass responsible ?<br></span></blockquote><div>
<br></div></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" target="_blank">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><font color="#888888"><div>-Chris</div></font></div><br></div></blockquote><div> </div></div>Thank you very much for the notes and answer!<br><br>--Matthieu<br>