[PATCH] Constant Hoisting Pass

Robinson, Paul Paul_Robinson at playstation.sony.com
Thu Jan 23 11:26:44 PST 2014


> -----Original Message-----
> From: Adrian Prantl [mailto:aprantl at apple.com]
> Sent: Thursday, January 23, 2014 11:13 AM
> To: Robinson, Paul
> Cc: Juergen Ributzka; LLVM Commits; Owen Anderson; Eric Christopher
> Subject: Re: [PATCH] Constant Hoisting Pass
> 
> 
> 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.

Hm.  Machine instructions with no explicit location will implicitly
inherit the location of the preceding instruction.[*]  Is that not what
happens with IR instructions?
--paulr

[*] This is not great when the preceding instruction is in a different
block, and I've poked at that from time to time. But is a digression from
this discussion.

> 
> 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