[PATCH] Constant Hoisting Pass

Adrian Prantl aprantl at apple.com
Thu Jan 23 11:13:07 PST 2014


On Jan 22, 2014, at 18:05, Robinson, Paul <Paul_Robinson at playstation.sony.com> wrote:

> With this kind of thing, I get concerned that moving stuff around will cause unnecessary chaos with debug info.  But it looks like the new instructions you’re creating don’t have a source location attached?  In this case that’s probably the right thing to do.  Let me know if I’m misunderstanding what’s going on here.

Not attaching any location will create a hole in the function, which is also not ideal. I’ve seen this cause interesting problems with inlining where the debugger then has no chance to know which of the abstract subroutines an instruction belongs to and stepping totally breaks.

If there really is no useful location for an instruction, IMHO it should get a location pointing to line 0 + a valid scope that belongs to the function. In Clang we have ArtificialLocation for this which is used for the helper functions emitted for Blocks in Objective C.

-- adrian



More information about the llvm-commits mailing list