<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 18 Aug 2017, at 16:02, Hal Finkel <<a href="mailto:hfinkel@anl.gov" class="">hfinkel@anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On 08/18/2017 08:16 AM, Daniel Sanders via llvm-commits wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Hi Matt,<br class=""><br class="">This change disabled IPRA on one of our out-of-tree targets. We are setting TM.Options.EnableIPRA but then the default path from this code is overriding our settings. I've worked around this locally by changing:<br class=""><blockquote type="cite" class="">+    // If not explicitly specified, use target default.<br class="">+    TM.Options.EnableIPRA = TM.useIPRA();<br class=""></blockquote>to use |= instead of =. Should we make this change upstream too or should we fix it another way?<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can you update your target to use the new callback?</span></div></blockquote><div><br class=""></div><div>Unfortunately, that won't work for us since useIPRA() configures the default for a target. We're using LLVM as a library and want to have it enabled for some compilations and disabled for others.</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Are you changing this in your target code or have you patched LLVM to change the default?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Hal</span><br class=""></div></blockquote><div><br class=""></div><div>I've patched our LLVM for the moment to keep our CI going but I'll switch it to whichever solution we choose here.</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Thanks<br class=""><br class=""><blockquote type="cite" class="">On 14 Aug 2017, at 20:54, Matt Arsenault via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: arsenm<br class="">Date: Mon Aug 14 12:54:47 2017<br class="">New Revision: 310876<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=310876&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=310876&view=rev</a><br class="">Log:<br class="">IPRA: Allow target to enable IPRA by default<br class=""><br class="">Modified:<br class="">   llvm/trunk/include/llvm/Target/TargetMachine.h<br class="">   llvm/trunk/lib/CodeGen/TargetPassConfig.cpp<br class="">   llvm/trunk/lib/Target/TargetMachine.cpp<br class=""><br class="">Modified: llvm/trunk/include/llvm/Target/TargetMachine.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=310876&r1=310875&r2=310876&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=310876&r1=310875&r2=310876&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)<br class="">+++ llvm/trunk/include/llvm/Target/TargetMachine.h Mon Aug 14 12:54:47 2017<br class="">@@ -259,6 +259,12 @@ public:<br class="">  /// PEI. If false (virtual-register machines), then callee-save register<br class="">  /// spilling and scavenging are not needed or used.<br class="">  virtual bool usesPhysRegsForPEI() const { return true; }<br class="">+<br class="">+  /// True if the target wants to use interprocedural register allocation by<br class="">+  /// default. The -enable-ipra flag can be used to override this.<br class="">+  virtual bool useIPRA() const {<br class="">+    return false;<br class="">+  }<br class="">};<br class=""><br class="">/// This class describes a target machine that is implemented with the LLVM<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/TargetPassConfig.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetPassConfig.cpp?rev=310876&r1=310875&r2=310876&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetPassConfig.cpp?rev=310876&r1=310875&r2=310876&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/TargetPassConfig.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/TargetPassConfig.cpp Mon Aug 14 12:54:47 2017<br class="">@@ -47,6 +47,9 @@<br class=""><br class="">using namespace llvm;<br class=""><br class="">+cl::opt<bool> EnableIPRA("enable-ipra", cl::init(false), cl::Hidden,<br class="">+                         cl::desc("Enable interprocedural register allocation "<br class="">+                                  "to reduce load/store at procedure calls."));<br class="">static cl::opt<bool> DisablePostRASched("disable-post-ra", cl::Hidden,<br class="">    cl::desc("Disable Post Regalloc Scheduler"));<br class="">static cl::opt<bool> DisableBranchFold("disable-branch-fold", cl::Hidden,<br class="">@@ -362,6 +365,13 @@ TargetPassConfig::TargetPassConfig(LLVMT<br class="">  if (StringRef(PrintMachineInstrs.getValue()).equals(""))<br class="">    TM.Options.PrintMachineCode = true;<br class=""><br class="">+  if (EnableIPRA.getNumOccurrences())<br class="">+    TM.Options.EnableIPRA = EnableIPRA;<br class="">+  else {<br class="">+    // If not explicitly specified, use target default.<br class="">+    TM.Options.EnableIPRA = TM.useIPRA();<br class="">+  }<br class="">+<br class="">  if (TM.Options.EnableIPRA)<br class="">    setRequiresCodeGenSCCOrder();<br class=""><br class=""><br class="">Modified: llvm/trunk/lib/Target/TargetMachine.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=310876&r1=310875&r2=310876&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=310876&r1=310875&r2=310876&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/TargetMachine.cpp (original)<br class="">+++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Aug 14 12:54:47 2017<br class="">@@ -31,10 +31,6 @@<br class="">#include "llvm/Target/TargetSubtargetInfo.h"<br class="">using namespace llvm;<br class=""><br class="">-cl::opt<bool> EnableIPRA("enable-ipra", cl::init(false), cl::Hidden,<br class="">-                         cl::desc("Enable interprocedural register allocation "<br class="">-                                  "to reduce load/store at procedure calls."));<br class="">-<br class="">//---------------------------------------------------------------------------<br class="">// TargetMachine Class<br class="">//<br class="">@@ -45,8 +41,6 @@ TargetMachine::TargetMachine(const Targe<br class="">    : TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),<br class="">      TargetFS(FS), AsmInfo(nullptr), MRI(nullptr), MII(nullptr), STI(nullptr),<br class="">      RequireStructuredCFG(false), DefaultOptions(Options), Options(Options) {<br class="">-  if (EnableIPRA.getNumOccurrences())<br class="">-    this->Options.EnableIPRA = EnableIPRA;<br class="">}<br class=""><br class="">TargetMachine::~TargetMachine() {<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></blockquote>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Hal Finkel</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Lead, Compiler Technology and Programming Languages</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Leadership Computing Facility</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Argonne National Laboratory</span></div></blockquote></div><br class=""></body></html>