mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 11:36:46 +00:00

This patch adds `nocallback` attributes for string/math libcalls. It allows FuncAttributor to infer `norecurse` more precisely and encourages more aggressive global optimization.
9 lines
430 B
LLVM
9 lines
430 B
LLVM
; RUN: opt < %s -mtriple=x86_64-- -passes=inferattrs -S | FileCheck --match-full-lines %s
|
|
|
|
; Frontends can emit math functions with 'readonly', don't crash on it.
|
|
|
|
; CHECK: declare double @acos(double) [[NOFREE_NOUNWIND_WILLRETURN_READNONE:#[0-9]+]]
|
|
declare double @acos(double) readonly
|
|
|
|
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN_READNONE]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
|