[PATCH] D126089: [WPD] Try harder to find assumes through phis

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 16:15:27 PDT 2022


aeubanks added a comment.

In D126089#3538760 <https://reviews.llvm.org/D126089#3538760>, @pcc wrote:

> This case is supposed to be handled as a result of running the WPD pass early. See the comment near the top of PassBuilder::buildThinLTODefaultPipeline:
>
>   // These passes import type identifier resolutions for whole-program
>   // devirtualization and CFI. They must run early because other passes may
>   // disturb the specific instruction patterns that these passes look for,
>   // creating dependencies on resolutions that may not appear in the summary.
>   //
>   // For example, GVN may transform the pattern assume(type.test) appearing in
>   // two basic blocks into assume(phi(type.test, type.test)), which would
>   // transform a dependency on a WPD resolution into a dependency on a type
>   // identifier resolution for CFI.
>   //
>   // Also, WPD has access to more precise information than ICP and can
>   // devirtualize more effectively, so it should operate on the IR first.
>   //
>   // The WPD and LowerTypeTest passes need to run at -O0 to lower type
>   // metadata and intrinsics.
>
> Is there some way that we can now end up with GVN or some other such pass running between when we create the summary and when we run WPD that's inserting a phi?

I thought the frontend emitted the type test/assume. I'm seeing them in the IR after the pre link step.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126089



More information about the llvm-commits mailing list