[PATCH] D13304: Avoid inlining in throw statement
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 8 14:03:27 PDT 2015
On Thu, Oct 8, 2015 at 9:54 AM, <junbuml at codeaurora.org> wrote:
> > I think this actually makes it less general. You would presumably perform
> > different inlining for:
> >
> > throw f(x, y);
> >
> > versus
> >
> > auto k = f(x, y);
> > throw k;
>
> We need to differentiate between these two. For the second case, we should
> not add any attribute because it’s not invoked in the EH region and it
> could have any other purposes other than exception handling. I believe we
> need to specifically handle only the case where we can guarantee that the
> call is invoked only in exception handling context.
Modulo copying the value returned by f, those two are equivalent, and it's
entirely reasonable to want to refactor one into the other. Such
refactoring should not affect the optimizer's behavior on this code. Why do
you think they should be treated differently?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151008/50af2d7e/attachment-0001.html>
More information about the cfe-commits
mailing list