When jump threading duplicates a basic block, it can demote register values defined in that block to the stack. This seems a bit inefficient - is the idea that you should run mem2reg afterwards to clean this up? "llvm-ld -O" runs jump threading but doesn't run any mem2reg pass afterwards, and I've seen several cases where variables end up left on the stack in the output of the linker. Thanks, Jay.
On Wed, 25 Jun 2008, Jay Foad wrote:> When jump threading duplicates a basic block, it can demote register > values defined in that block to the stack. This seems a bit > inefficient - is the idea that you should run mem2reg afterwards to > clean this up? > > "llvm-ld -O" runs jump threading but doesn't run any mem2reg pass > afterwards, and I've seen several cases where variables end up left on > the stack in the output of the linker.Wow, this sounds like a serious bug. jump threading definitely needs mem2reg to be run after it. -Chris -- http://nondot.org/sabre/ http://llvm.org/
On Wed, 25 Jun 2008, Chris Lattner wrote:>> "llvm-ld -O" runs jump threading but doesn't run any mem2reg pass >> afterwards, and I've seen several cases where variables end up left on >> the stack in the output of the linker. > > Wow, this sounds like a serious bug. jump threading definitely needs > mem2reg to be run after it.This should be fixed now, I also filed PR2495 about a potential compile-time speedup here. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Maybe Matching Threads
- [LLVMdev] jump threading and the stack
- Questions about jump threading optimization and what we can do
- Questions about jump threading optimization and what we can do
- Questions about jump threading optimization and what we can do
- Questions about jump threading optimization and what we can do