1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/test/Transforms/FunctionAttrs/optnone.ll
Chandler Carruth 710380f52f [attrs] Move the norecurse deduction to operate on the node set rather
than the SCC object, and have it scan the instruction stream directly
rather than relying on call records.

This makes the behavior of this routine consistent between libc routines
and LLVM intrinsics for libc routines. We can go and start teaching it
about those being norecurse, but we should behave the same for the
intrinsic and the libc routine rather than differently. I chatted with
James Molloy and the inconsistency doesn't seem intentional and likely
is due to intrinsic calls not being modelled in the call graph analyses.

This also fixes a bug where we would deduce norecurse on optnone
functions, when generally we try to handle optnone functions as-if they
were replaceable and thus unanalyzable.

llvm-svn: 260813
2016-02-13 08:47:51 +00:00

25 lines
508 B
LLVM

; RUN: opt < %s -functionattrs -S | FileCheck %s
@x = global i32 0
define void @test_opt(i8* %p) {
; CHECK-LABEL: @test_opt
; CHECK: (i8* nocapture readnone %p) #0 {
ret void
}
define void @test_optnone(i8* %p) noinline optnone {
; CHECK-LABEL: @test_optnone
; CHECK: (i8* %p) #1 {
ret void
}
declare i8 @strlen(i8*) noinline optnone
; CHECK-LABEL: @strlen
; CHECK: (i8*) #1
; CHECK-LABEL: attributes #0
; CHECK: = { norecurse readnone }
; CHECK-LABEL: attributes #1
; CHECK: = { noinline optnone }