[LLVMdev] opt + fastcc bug?

Nicolas Ojeda Bar nojb at math.harvard.edu
Wed Apr 6 22:48:17 PDT 2011


Hi,

Is this correct behaviour?

test.ll:

declare {} @__ex__print_int(i64)

define i32 @main() {
entry:
  %0 = call i64 @f.1()
  %1 = call {} @__ex__print_int(i64 %0)
  ret i32 0
}

define internal fastcc i64 @f.1() {
entry:
  ret i64 7
}

> opt -std-compile-opts test.ll -S

; ModuleID = 'test.ll'

define i32 @main() noreturn nounwind {
entry:
  tail call void @llvm.trap()
  unreachable
}

declare void @llvm.trap() nounwind

If I remove fastcc then everything works as expected.
Does this mean that one shouldn't use opt when you
use fastcc functions (which are required when implementing
tail recursive languages!)?

Thanks!
N



More information about the llvm-dev mailing list