[cfe-dev] "load groups" IR feature to improve C++ devirtualization

Nick Lewycky nlewycky at google.com
Wed May 22 16:27:20 PDT 2013

On 22 May 2013 11:44, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> > where %group must be the result of a call to llvm.load.group. Any two
> loads
> > with the same %group value are known to produce the same value. We can
> then
> > choose to eliminate the latter of the loads as redundant in GVN, or in
> the
> > event of high register pressure we could choose to reload without
> spilling
> > to the stack.
> What mark would GVN leave on the IR for the register allocator to use
> when rematerializing the load?

It's something novel we would have to create, probably by slapping metadata
on the load.

This proposal is dead, in favour of my newer proposal for @llvm.newobject
(in the same thread). That proposal is stalled because it relies on picking
a certain interpretation of the C++ standard in an area where the standard
is self-contradictory.

There are other issues in devirtualization which I can make progress on
(PR11331 is one, and "knowing the initial value of the vtable
post-constructor where the constructor is not defined in this translation
unit" is another), but I think I need to drop the category of "same pointer
implies same vtable" optimizations until there are language changes that
support it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130522/2201cd44/attachment.html>

More information about the cfe-dev mailing list