<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 11, 2014, at 2:49 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">----- Original Message -----<br><blockquote type="cite">From: "Quentin Colombet" <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>><br>To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>Sent: Friday, April 11, 2014 4:39:45 PM<br>Subject: [llvm] r206072 - [RegAllocGreedy][Last Chance Recoloring] Addition of<br><br>Author: qcolombet<br>Date: Fri Apr 11 16:39:44 2014<br>New Revision: 206072<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=206072&view=rev">http://llvm.org/viewvc/llvm-project?rev=206072&view=rev</a><br>Log:<br>[RegAllocGreedy][Last Chance Recoloring] Addition of<br>-fexhaustive-register-search option to allow an exhaustive search<br>during last<br>chance recoloring.<br><br>This is related to PR18747<br><br>Patch by MAYUR PANDEY <<a href="mailto:mayur.p@samsung.com">mayur.p@samsung.com</a>>.<br><br>Modified:<br>   llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp<br>   llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll<br><br>Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=206072&r1=206071&r2=206072&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=206072&r1=206071&r2=206072&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Fri Apr 11 16:39:44<br>2014<br>@@ -73,6 +73,11 @@ static cl::opt<unsigned> LastChanceRecol<br>             " interference at a time"),<br>    cl::init(8));<br><br>+static cl::opt<bool><br>+ExhaustiveSearch("fexhaustive-register-search", cl::NotHidden,<br></blockquote><br>We don't normally name these things with a 'f' in front inside LLVM proper. That's a Clang thing ;)<br><br></div></blockquote>Good point!</div><div>I’ll remove it.</div><div><br></div><div>-Quentin<br><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-Hal<br><br><blockquote type="cite">+                 cl::desc("Exhaustive Search for registers bypassing<br>the depth "<br>+                          "and interference cutoffs of last chance<br>recoloring"));<br>+<br>// FIXME: Find a good default for this flag and remove the flag.<br>static cl::opt<unsigned><br>CSRFirstTimeCost("regalloc-csr-first-time-cost",<br>@@ -1932,7 +1937,7 @@ RAGreedy::mayRecolorAllInterferences(uns<br>    // If there is LastChanceRecoloringMaxInterference or more<br>    interferences,<br>    // chances are one would not be recolorable.<br>    if<br>    (Q.collectInterferingVRegs(LastChanceRecoloringMaxInterference)<br><blockquote type="cite">=<br></blockquote>-        LastChanceRecoloringMaxInterference) {<br>+        LastChanceRecoloringMaxInterference && !ExhaustiveSearch) {<br>      DEBUG(dbgs() << "Early abort: too many interferences.\n");<br>      CutOffInfo |= CO_Interf;<br>      return false;<br>@@ -2005,7 +2010,7 @@ unsigned RAGreedy::tryLastChanceRecolori<br>  // We may want to reconsider that if we end up with a too large<br>  search space<br>  // for target with hundreds of registers.<br>  // Indeed, in that case we may want to cut the search space<br>  earlier.<br>-  if (Depth >= LastChanceRecoloringMaxDepth) {<br>+  if (Depth >= LastChanceRecoloringMaxDepth && !ExhaustiveSearch) {<br>    DEBUG(dbgs() << "Abort because max depth has been reached.\n");<br>    CutOffInfo |= CO_Depth;<br>    return ~0u;<br>@@ -2139,14 +2144,17 @@ unsigned RAGreedy::selectOrSplit(LiveInt<br>  if (Reg == ~0U && (CutOffInfo != CO_None)) {<br>    uint8_t CutOffEncountered = CutOffInfo & (CO_Depth | CO_Interf);<br>    if (CutOffEncountered == CO_Depth)<br>-      Ctx.emitError(<br>-          "register allocation failed: maximum depth for recoloring<br>reached");<br>+      Ctx.emitError("register allocation failed: maximum depth for<br>recoloring "<br>+                    "reached. Use -fexhaustive-register-search to<br>skip "<br>+                    "cutoffs");<br>    else if (CutOffEncountered == CO_Interf)<br>      Ctx.emitError("register allocation failed: maximum<br>      interference for "<br>-                    "recoloring reached");<br>+                    "recoloring reached. Use<br>-fexhaustive-register-search "<br>+                    "to skip cutoffs");<br>    else if (CutOffEncountered == (CO_Depth | CO_Interf))<br>      Ctx.emitError("register allocation failed: maximum<br>      interference and "<br>-                    "depth for recoloring reached");<br>+                    "depth for recoloring reached. Use "<br>+                    "-fexhaustive-register-search to skip cutoffs");<br>  }<br>  return Reg;<br>}<br><br>Modified:<br>llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll?rev=206072&r1=206071&r2=206072&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll?rev=206072&r1=206071&r2=206072&view=diff</a><br>==============================================================================<br>--- llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll<br>(original)<br>+++ llvm/trunk/test/CodeGen/X86/ragreedy-last-chance-recoloring.ll<br>Fri Apr 11 16:39:44 2014<br>@@ -8,6 +8,10 @@<br>; RUN: not llc -regalloc=greedy -relocation-model=pic<br>-lcr-max-interf=1  < %s 2>&1 | FileCheck %s<br>--check-prefix=CHECK-INTERF<br>; Test whether failure due to cutoff for interference is reported<br><br>+; RUN: llc -regalloc=greedy -relocation-model=pic -lcr-max-interf=1<br>-lcr-max-depth=0 -fexhaustive-register-search < %s > %t 2>&1<br>+; RUN: FileCheck --input-file=%t %s --check-prefix=CHECK-EXHAUSTIVE<br>+; Test whether fexhaustive-register-search can bypass the depth and<br>interference cutoffs of last chance recoloring<br>+<br>target datalayout =<br>"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"<br>target triple = "i386-apple-macosx"<br><br>@@ -20,6 +24,7 @@ target triple = "i386-apple-macosx"<br>; CHECK-NOT: ran out of registers during register allocation<br>; CHECK-INTERF: error: register allocation failed: maximum<br>interference for recoloring reached<br>; CHECK-DEPTH: error: register allocation failed: maximum depth for<br>recoloring reached<br>+; CHECK-EXHAUSTIVE-NOT: error: register allocation failed: maximum<br>{{depth|interference}} for recoloring reached<br>define void @fp_dh_f870bf31fd8ffe068450366e3f05389a(i8* %arg) #0 {<br>bb:<br>  indirectbr i8* undef, [label %bb85, label %bb206]<br><br><br>_______________________________________________<br>llvm-commits mailing list<br>llvm-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</div></blockquote></div><br></body></html>