[all-commits] [llvm/llvm-project] 4358e6: [FuncAttrs] Infer `norecurse` for funcs with calls...
Yingwei Zheng via All-commits
all-commits at lists.llvm.org
Tue Dec 26 11:16:57 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7
https://github.com/llvm/llvm-project/commit/4358e6e0c5b1f08de60b6b2fb015a06ab6760ee7
Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: 2023-12-27 (Wed, 27 Dec 2023)
Changed paths:
M clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/vlenb.c
M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
M llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
M llvm/test/Transforms/FunctionAttrs/argmemonly.ll
M llvm/test/Transforms/FunctionAttrs/convergent.ll
M llvm/test/Transforms/FunctionAttrs/int_sideeffect.ll
M llvm/test/Transforms/FunctionAttrs/make-buffer-rsrc.ll
M llvm/test/Transforms/FunctionAttrs/nocapture.ll
M llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll
M llvm/test/Transforms/FunctionAttrs/norecurse.ll
M llvm/test/Transforms/FunctionAttrs/nosync.ll
M llvm/test/Transforms/FunctionAttrs/readattrs.ll
M llvm/test/Transforms/FunctionAttrs/writeonly.ll
Log Message:
-----------
[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.
More information about the All-commits
mailing list