[PATCH] D67058: [clang][CodeGen] Add alias for cpu_dispatch function with IFunc

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 06:31:27 PDT 2019


erichkeane added a comment.

I prefer this to be in the place where the ifunc gets created, otherwise we definitely need tests.  There are sufficient tests for this that show the ifunc having been created, so I'd suggest just adding to them.



================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2957
+    if (!AliasFunc) {
+      auto *IFunc = cast<llvm::GlobalIFunc>(GetOrCreateLLVMFunction(
+          AliasName, DeclTy, GD, /*ForVTable=*/false, /*DontDefer=*/true,
----------------
I think we want this in GetOrCreateMultiVersionResolver, so that it gets created when the ifunc does.  That way you just need a "FD->isCPUDispatchMultiVersion() || isCPUSpecificMultiVersion()" check inside the supportsIFunc branch.


Repository:
  rC Clang

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

https://reviews.llvm.org/D67058





More information about the cfe-commits mailing list