[nix-shell:~/tmp]$ cat test.ll
define internal fastcc void @foo() {
Entry:
call fastcc void @bar()
ret void
}
; Function Attrs: alwaysinline
define internal fastcc void @bar() #0 {
Entry:
ret void
}
attributes #0 = { alwaysinline }
[nix-shell:~/tmp]$ opt test.ll -always-inline -S
; ModuleID = 'test.ll'
source_filename = "test.ll"
define internal fastcc void @foo() {
Entry:
call fastcc void @bar()
ret void
}
; Function Attrs: alwaysinline
define internal fastcc void @bar() #0 {
Entry:
ret void
}
attributes #0 = { alwaysinline }
If I delete "internal" from foo, then the optimziation pass in fact inlines bar. Is this intentional? Is there a way to make the always inliner pass work on internal functions like this too?