LLVM does a reasonably good job of optimizing our stack manipulation. In
particular, if we push and pop something without any intervening writes to
other objects, it will skip the read and use the original llvm::Value that
was written. Unfortunately, right now it doesn't have very good alias
information, so if there are any memory writes between the stack
manipulation, it has to reload the value from the stack.
We should improve the alias analysis so that it knows things like
"PyObject*'s and pointers derived from them do not alias the stack". This
is actually a lie in the case of PyFrameObjects, so we'd need to qualify
that statement. We could do something more broad like type-based alias
analysis (TBAA), but that's trickier and harder to get right.
IIRC Jörg had was looking into a patch that to PyAliasAnalysis along these
lines.
Original issue reported on code.google.com by reid.kle...@gmail.com on 26 Jan 2010 at 3:37
Original issue reported on code.google.com by
reid.kle...@gmail.com
on 26 Jan 2010 at 3:37