[PATCH] D135429: [HLSL] [DirectX backend] Move generateGlobalCtorDtorCalls into DirectX backend.

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 14:46:49 PDT 2022


python3kgae added a comment.

In D135429#3843906 <https://reviews.llvm.org/D135429#3843906>, @efriedma wrote:

> You might actually want to run this twice, once early, and once in the backend.  Early to get high-quality optimization, late in case optimizations don't run for some reason.  (Not sure how that works if `T.getEnvironment() == Triple::EnvironmentType::Library`, though, since we don't actually erase the constructors?)

The pass will be always enabled in registerPipelineEarlySimplificationEPCallback (Not controlled by optimization level),  is it possible that things registered in registerPipelineEarlySimplificationEPCallback be skipped?

For the library case, we'll have to erase the constructors after generating calls for them in the entry function when linking.
In case the target profile is still library when linking, we'll have to merge the constructors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135429



More information about the cfe-commits mailing list