[cfe-dev] C++11 and enhacned devirtualization

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jul 16 10:14:29 PDT 2015


On 16 July 2015 at 10:02, Piotr Padlewski <prazek at google.com> wrote:
> The proposal of our solution will be published next week. Brief
> introduction:
>
> "Basic idea is to mark vtable loads with !invariant , and also put assume()
> after calling constructor to show how vtable will look like. Function
> @llvm.invariant.barrier that breaks the invariant will be needed to cope
> with placement new and other cases where the vptr is legitimately permitted
> to change."


Nice, this should also avoid loading the vtable pointer multiple times in

struct C {
  virtual void foo();
};
void g();
void f(C *x) {
  x->foo();
  g();
  x->foo();
}

Cheers,
Rafael



More information about the cfe-dev mailing list