aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorYingwei Zheng <dtcxzyw2333@gmail.com>2023-12-27 03:16:43 +0800
committerGitHub <noreply@github.com>2023-12-27 03:16:43 +0800
commit4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7 (patch)
treed0d219fd3368ebe4c0a1b4cec60eb93af9df42eb /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentb80e1acc8cfb82158255de24fb2887acd72a4049 (diff)
downloadllvm-4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7.zip
llvm-4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7.tar.gz
llvm-4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7.tar.bz2
[FuncAttrs] Infer `norecurse` for funcs with calls to `nocallback` callees (#76372)
This patch adds missing `norecurse` attrs to funcs that only call intrinsics with `nocallback` attrs. Fixes the regression found in https://github.com/dtcxzyw/llvm-opt-benchmark/pull/45#discussion_r1436148743. The function loses `norecurse` attr because it calls `@llvm.fabs.f64`, which is not marked as `norecurse`. Since `norecurse` is not a default attribute of intrinsics and it is ambiguous for intrinsics, I decided to use the existing `callback` attributes. > nocallback This attribute indicates that the function is only allowed to jump back into caller’s module by a return or an exception, and is not allowed to jump back by invoking a callback function, a direct, possibly transitive, external function call, use of longjmp, or other means. It is a compiler hint that is used at module level to improve dataflow analysis, dropped during linking, and has no effect on functions defined in the current module. See also https://llvm.org/docs/LangRef.html#function-attributes.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions