<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 15, 2017 at 9:17 AM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Teresa Johnson via Phabricator via llvm-commits<br>
<div><div class="h5"><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> writes:<br>
<br>
> tejohnson created this revision.<br>
> Herald added subscribers: inglorion, mehdi_amini.<br>
><br>
> The Value::getComdat interface (invoked by GlobalValue::getComdat) knows<br>
> how to handle ifuncs. Use this instead of getting the base object and<br>
> invoking getComdat on it. This was causing LTO to warn about<br>
> "Unable to determine comdat of alias!" for an ifunc.<span style="color:rgb(34,34,34)"> </span></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><br>
><br>
> <a href="https://reviews.llvm.org/D33202" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33202</a><br>
><br>
> Files:<br>
>   lib/Object/IRSymtab.cpp<br>
>   test/LTO/Resolution/X86/ifunc.<wbr>ll<br>
><br>
><br>
> Index: test/LTO/Resolution/X86/ifunc.<wbr>ll<br>
> ==============================<wbr>==============================<wbr>=======<br>
> --- /dev/null<br>
> +++ test/LTO/Resolution/X86/ifunc.<wbr>ll<br>
> @@ -0,0 +1,15 @@<br>
> +; RUN: opt -module-summary -o %t.bc %s<br>
> +; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,pl -o %t2<br>
> +; RUN: llvm-nm %t2.0 | FileCheck %s<br>
> +; CHECK: T foo<br>
> +; CHECK: t foo_ifunc<br>
> +<br>
> +target datalayout = "e-m:e-i64:64-f80:128-n8:16:<wbr>32:64-S128"<br>
> +target triple = "x86_64-unknown-linux-gnu"<br>
> +<br>
> +@foo = ifunc i32 (i32), i64 ()* @foo_ifunc<br>
> +<br>
> +define internal i64 @foo_ifunc() {<br>
> +entry:<br>
> +  ret i64 0<br>
> +}<br>
> Index: lib/Object/IRSymtab.cpp<br>
> ==============================<wbr>==============================<wbr>=======<br>
> --- lib/Object/IRSymtab.cpp<br>
> +++ lib/Object/IRSymtab.cpp<br>
> @@ -188,11 +188,7 @@<br>
>      Uncommon().CommonAlign = GV->getAlignment();<br>
>    }<br>
><br>
> -  const GlobalObject *Base = GV->getBaseObject();<br>
> -  if (!Base)<br>
> -    return make_error<StringError>("<wbr>Unable to determine comdat of alias!",<br>
> -                                   inconvertibleErrorCode());<br>
> -  if (const Comdat *C = Base->getComdat()) {<br>
> +  if (const Comdat *C = GV->getComdat()) {<br>
>      auto P = ComdatMap.insert(std::make_<wbr>pair(C, Comdats.size()));<br>
>      Sym.ComdatIndex = P.first->second;<br>
<br>
</div></div>I think you have to fix GlobalValue::getBaseObject instead. The only<br>
thing wrong with the above code is the error message. If there is any<br>
GlobalIndirectSymbol for which we cannot find the base, we should<br>
conservatively error.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br>Done. Uploading new patch and will change description.</div><div class="gmail_extra">Thanks,</div><div class="gmail_extra">Teresa<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>