<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 30, 2009, at 12:06 AM, Talin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I'm playing around with different combinations of LTO passes, and I've run into a strange problem:<div><br></div><div>I have a 'main' function that looks like this:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">

define i32 @"main(tart.core.Array[tart.core.String])->int"(%"tart.core.Array[tart.core.String]"* %args) {<br>entry:<br>  call void @llvm.dbg.func.start(metadata !0)<br>  call void @llvm.dbg.stoppoint(i32 2, i32 19, metadata !1)<br>

  %integerLimitsTest = call { } @integerLimitsTest() ; <{ }> [#uses=0]<br>  call void @llvm.dbg.stoppoint(i32 3, i32 21, metadata !1)<br>  %integerToStringTest = call { } @integerToStringTest() ; <{ }> [#uses=0]<br>

  call void @llvm.dbg.stoppoint(i32 4, i32 9, metadata !1)<br>  call void @llvm.dbg.region.end(metadata !0)<br>  ret i32 0<br>}</blockquote><div><div><br></div><div>However, when I add an internalize pass before the other LTO passes, the 'main' function turns into this:</div>

<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">define i32 @main(i32, i8** nocapture) nounwind readnone {<br>entry:<br>  tail call void @llvm.dbg.func.start(metadata !0)<br>
  tail call void @llvm.dbg.stoppoint(i32 3, i32 21, metadata !1)<br>  unreachable<br>}</blockquote><div><div><div><br></div><div>The thing is, there's nothing particularly special or interesting about the functions being called from main().</div>

</div></div></blockquote></div><br><div>This is likely to not be due to internalize itself.  Internalize marks functions "internal", which allows other interprocedural optimizers to have more freedom to change their interfaces etc.  The likely problem here is that you are calling something from 'main' with mismatching calling conventions or something like that.  It is hard to say without a full testcase.</div><div><br></div><div>-Chris</div></body></html>