This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; RUN: opt -S -passes='cgscc(inline,instcombine)' < %s | FileCheck %s | |
; We use call to a dummy function to avoid inlining test1 into test2 or vice | |
; versa, such that we aren't left with a trivial cycle, as trivial cycles are | |
; special-cased to never be inlined. | |
; However, InstCombine will eliminate these calls after inlining, and thus | |
; make the functions eligible for inlining in their callers. | |
declare void @dummy() readnone nounwind willreturn | |
define void @test1() { | |
call void @test2() | |
call void @test2() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
ret void | |
} | |
define void @test2() { | |
call void @test1() | |
call void @test1() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
call void @dummy() | |
ret void | |
} | |
define void @test3() { | |
call void @test2() | |
call void @test2() | |
ret void | |
} | |
define void @test4() { | |
call void @test3() | |
call void @test3() | |
ret void | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment