<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I've been porting a project to LLVM 3.9 and found that the SCCP pass may remove calls to external functions if their return type is declared to be an empty struct. For instance:</div><div class=""><br class=""></div><div class=""><div class=""></div><div class=""></div><blockquote type="cite" class=""><div class="">%empty = type {}</div><br class=""><div class="">declare %empty @foo()</div><br class=""><div class="">define i32 @main() {</div><div class="">  %1 = call %empty @foo()</div><div class="">  ret i32 0</div><div class="">}</div></blockquote></div><div class=""><div class=""><br class=""></div><div class="">opt -sccp -S file.ll returns:</div><div class=""><br class=""></div><div class=""><div class=""></div><blockquote type="cite" class=""><div class="">%empty = type {}</div><div class=""><br class=""></div><div class="">declare %empty @foo()</div><div class=""><br class=""></div><div class="">define i32 @main() {</div><div class="">  ret i32 0</div><div class="">}</div></blockquote></div><div class=""><br class="webkit-block-placeholder"></div><div class="">It doesn't look right to remove a call to an external function (especially since the call isn't removed if `@foo` returns a `void` instead). It didn't happen with LLVM 3.8.</div><div class=""><br class=""></div><div class="">I'm using the Mac OS X prebuilt binaries for RC2.</div><div class=""><br class=""></div><div class="">Assuming that this is a bug, what are the next steps?</div><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">FĂ©lix</span>
</div>
<br class=""></div></body></html>