[PATCH] D104798: [WPD] Don't optimize calls more than once

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 14:23:59 PDT 2021


tejohnson added a comment.

In D104798#2836775 <https://reviews.llvm.org/D104798#2836775>, @aeubanks wrote:

> This probably requires more test coverage, but I'm not super familiar
>
> In D104798#2836614 <https://reviews.llvm.org/D104798#2836614>, @tejohnson wrote:
>
>>> WPD currently assumes that each vtable load corresponds to one virtual call. However, with -fstrict-vtable-pointers this may not be true.
>>
>> In the test case there is still a one to one correlation between the vtable load and virtual call. Do you mean that it can correspond to more than one type test assume sequence?
>
> Originally there are two vtable loads, each with a type test assume sequence. The vtable loads become coalesced, leaving two type test assume sequences for one vtable load.

I assume -fstrict-vtable-pointers was what allowed the vtable loads to be coalesced? The description seems wrong though, since it is talking about one vtable load to one virtual call, and here that is still the case. I'm a little confused - in the test case why would there originally have been 2 vtable loads for that single virtual call?

It looks like the issue is that we no longer have a one to one correspondence between type test assume sequences and virtual calls - is that correct?

Also, do we need to do something similar for singleImplDevirt, or why does this issue not occur there?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104798/new/

https://reviews.llvm.org/D104798



More information about the llvm-commits mailing list