jump threading and the stack

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.

Wow, this sounds like a serious bug. jump threading definitely needs mem2reg to be run after it.

-Chris

This should be fixed now, I also filed PR2495 about a potential compile-time speedup here.

-Chris