diff options
author | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2024-06-24 12:01:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 12:01:48 +0100 |
commit | 3d8079229e7571a5912e880bf7a960d809c8ee96 (patch) | |
tree | cc4d6505c31f8009a09491316e35ec6daf6e990c /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | a66900be7507eb0c68a6eff1e945e1823507d3e0 (diff) | |
download | llvm-3d8079229e7571a5912e880bf7a960d809c8ee96.zip llvm-3d8079229e7571a5912e880bf7a960d809c8ee96.tar.gz llvm-3d8079229e7571a5912e880bf7a960d809c8ee96.tar.bz2 |
[clang][AArch64][FMV] Stop emitting alias to ifunc. (#96221)
Long story short the interaction of two optimizations happening in
GlobalOpt results in a crash. For more details look at the issue
https://github.com/llvm/llvm-project/issues/96197. I will be fixing this
in GlobalOpt but it is a conservative solution since it won't allow us
to optimize resolvers which return a pointer to a function whose
definition is in another TU when compiling without LTO:
```
__attribute__((target_version("simd"))) void bar(void);
__attribute__((target_version("default"))) void bar(void);
int foo() { bar(); }
```
fixes: #96197
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index dd4a665..7653447 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4259,8 +4259,8 @@ void CodeGenModule::emitMultiVersionFunctions() { llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD); if (auto *IFunc = dyn_cast<llvm::GlobalIFunc>(ResolverConstant)) { ResolverConstant = IFunc->getResolver(); - if (FD->isTargetClonesMultiVersion() || - FD->isTargetVersionMultiVersion()) { + if (FD->isTargetClonesMultiVersion() && + !getTarget().getTriple().isAArch64()) { std::string MangledName = getMangledNameImpl( *this, GD, FD, /*OmitMultiVersionMangling=*/true); if (!GetGlobalValue(MangledName + ".ifunc")) { |