This patch marks some library functions as willreturn. On the first pass, I excluded most functions that interact with streams/the filesystem. Along with willreturn, it also adds nounwind to a set of math functions. There probably are a few additional attributes we can add for those, but that should be done separately. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D94684
20 lines
433 B
LLVM
20 lines
433 B
LLVM
; RUN: opt -S -inferattrs -basic-aa -licm < %s | FileCheck %s
|
|
|
|
define void @test(i64* noalias %loc, i8* noalias %a) {
|
|
; CHECK-LABEL: @test
|
|
; CHECK: @strlen
|
|
; CHECK-LABEL: loop:
|
|
br label %loop
|
|
|
|
loop:
|
|
%res = call i64 @strlen(i8* %a)
|
|
store i64 %res, i64* %loc
|
|
br label %loop
|
|
}
|
|
|
|
; CHECK: declare i64 @strlen(i8* nocapture) #0
|
|
; CHECK: attributes #0 = { argmemonly nofree nounwind readonly willreturn }
|
|
declare i64 @strlen(i8*)
|
|
|
|
|