<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 20, 2016 at 3:55 PM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Fri, Sep 16, 2016 at 8:15 AM, Chuck Atkins via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">ping?<br><div class="gmail_extra"><br></div><div class="gmail_extra">Anybody mind taking a look at this patch?  It's fairly trivial; but without it, builds with the Intel compiler fail.<br></div></div></blockquote><div><br></div></span><div>What is the failure mode?</div></div></div></div></blockquote><div><br></div><div><br></div><div>Out of curiosity, does the following make ICC any happier:</div><div><br></div><div><div>diff --git a/lib/Transforms/Utils/LoopUtils.cpp b/lib/Transforms/Utils/LoopUtils.cpp</div><div>index 8878689..1b2a2d6 100644</div><div>--- a/lib/Transforms/Utils/LoopUtils.cpp</div><div>+++ b/lib/Transforms/Utils/LoopUtils.cpp</div><div>@@ -929,6 +929,13 @@ SmallVector<Instruction *, 8> llvm::findDefsUsedOutsideOfLoop(Loop *L) {</div><div>   return UsedOutside;</div><div> }</div><div> </div><div>+// We locally access their IDs here because users shouldn't directly get them</div><div>+// from this header.</div><div>+namespace llvm {</div><div>+extern char &LoopSimplifyID;</div><div>+extern char &LCSSAID;</div><div>+}</div><div>+</div><div> void llvm::getLoopAnalysisUsage(AnalysisUsage &AU) {</div><div>   // By definition, all loop passes need the LoopInfo analysis and the</div><div>   // Dominator tree it depends on. Because they all participate in the loop</div><div>@@ -938,10 +945,7 @@ void llvm::getLoopAnalysisUsage(AnalysisUsage &AU) {</div><div>   AU.addRequired<LoopInfoWrapperPass>();</div><div>   AU.addPreserved<LoopInfoWrapperPass>();</div><div> </div><div>-  // We must also preserve LoopSimplify and LCSSA. We locally access their IDs</div><div>-  // here because users shouldn't directly get them from this header.</div><div>-  extern char &LoopSimplifyID;</div><div>-  extern char &LCSSAID;</div><div>+  // We must also preserve LoopSimplify and LCSSA.</div><div>   AU.addRequiredID(LoopSimplifyID);</div><div>   AU.addPreservedID(LoopSimplifyID);</div><div>   AU.addRequiredID(LCSSAID);</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><div dir="ltr"><div class="gmail_extra"><br></div><div><div><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 13, 2016 at 11:38 AM, Chuck Atkins <span dir="ltr"><<a href="mailto:chuck.atkins@kitware.com" target="_blank">chuck.atkins@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When LCSSAID and LoopSimplifyID are declared extern inside a function body,<br>
some linkers will fail to resolve the actual symbols defined in the llvm<br>
namespace.  By removing the function local extern declarations and relying<br>
on the header definitions in Scalar.h, the symbols can be properly reolved.<br>
This is specifically an issue when building with the Intel compiler.<br>
---<br>
 lib/Transforms/Utils/LoopUtil<wbr>s.cpp | 3 +--<br>
 1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/lib/Transforms/Utils/LoopUti<wbr>ls.cpp b/lib/Transforms/Utils/LoopUti<wbr>ls.cpp<br>
index 3902c67..9a1cd0b 100644<br>
--- a/lib/Transforms/Utils/LoopUti<wbr>ls.cpp<br>
+++ b/lib/Transforms/Utils/LoopUti<wbr>ls.cpp<br>
@@ -26,6 +26,7 @@<br>
 #include "llvm/IR/ValueHandle.h"<br>
 #include "llvm/Pass.h"<br>
 #include "llvm/Support/Debug.h"<br>
+#include "llvm/Transforms/Scalar.h"<br>
 #include "llvm/Transforms/Utils/LoopUti<wbr>ls.h"<br>
<br>
 using namespace llvm;<br>
@@ -845,8 +846,6 @@ void llvm::getLoopAnalysisUsage(Ana<wbr>lysisUsage &AU) {<br>
<br>
   // We must also preserve LoopSimplify and LCSSA. We locally access their IDs<br>
   // here because users shouldn't directly get them from this header.<br>
-  extern char &LoopSimplifyID;<br>
-  extern char &LCSSAID;<br>
   AU.addRequiredID(LoopSimplify<wbr>ID);<br>
   AU.addPreservedID(LoopSimplif<wbr>yID);<br>
   AU.addRequiredID(LCSSAID);<br>
<span><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div></div></div></div>
<br></div></div><span class="gmail-">______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br></span></blockquote></div><br></div></div>
</blockquote></div><br></div></div>