[all-commits] [llvm/llvm-project] c719d7: [FMV][AArch64] Do not optimize away runtime checks...
Alexandros Lamprineas via All-commits
all-commits at lists.llvm.org
Fri Jul 19 07:17:28 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c719d7b390481b095c7498fe75a0bcf60a24bad9
https://github.com/llvm/llvm-project/commit/c719d7b390481b095c7498fe75a0bcf60a24bad9
Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
Date: 2024-07-19 (Fri, 19 Jul 2024)
Changed paths:
M clang/lib/CodeGen/CodeGenFunction.cpp
M clang/test/CodeGen/attr-target-clones-aarch64.c
M clang/test/CodeGen/attr-target-version.c
Log Message:
-----------
[FMV][AArch64] Do not optimize away runtime checks for implied features (#99522)
When generating the body of the ifunc resolver, clang skips runtime
checks for features that are implied from the command line. We bend this
rule for certain features (memtag, bti, dgh), but this happens quite
arbitrarily in my opinion. The reasoning is that some features are in
the HINT instruction space, meaning they operate as NOPs if the hardware
does not support them. Still the user wants to detect their presence
with runtime checks. See #90928 for details.
I think we should always perform runtime checks regardless of the
feature and then try to statically resolve calls whenever a function is
compiled with a sufficiently high set of architecture features (so
including target/target_version/target_clones attributes, and command
line options). This is what GCC does. We have an open PR in LLVM
GlobalOpt since it was suggested not to perform such codegen
optimizations in clang anyway. See #87939.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list