<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2017, at 3:57 PM, Matthias Braun <<a href="mailto:mbraun@apple.com" class="">mbraun@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><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=""><br class="Apple-interchange-newline">On Jun 2, 2017, at 3:46 PM, Quentin Colombet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: qcolombet<br class="">Date: Fri Jun  2 17:46:26 2017<br class="">New Revision: 304602<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=304602&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=304602&view=rev</a><br class="">Log:<br class="">[RABasic] Properly initialize the pass<br class=""><br class="">Use the initializeXXX method to initialize the RABasic pass in the<br class="">pipeline. This enables us to take advantage of the .mir infrastructure.<br class=""><br class="">Modified:<br class="">  llvm/trunk/include/llvm/CodeGen/Passes.h<br class="">  llvm/trunk/include/llvm/InitializePasses.h<br class="">  llvm/trunk/lib/CodeGen/CodeGen.cpp<br class="">  llvm/trunk/lib/CodeGen/RegAllocBasic.cpp<br class="">  llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir<br class=""><br class="">Modified: llvm/trunk/include/llvm/CodeGen/Passes.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=304602&r1=304601&r2=304602&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=304602&r1=304601&r2=304602&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/CodeGen/Passes.h (original)<br class="">+++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Jun  2 17:46:26 2017<br class="">@@ -140,6 +140,9 @@ namespace llvm {<br class=""> /// Greedy register allocator.<br class=""> extern char &RAGreedyID;<br class=""><br class="">+  /// Basic register allocator.<br class="">+  extern char &RABasicID;<br class="">+<br class=""> /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as<br class=""> /// assigned in VirtRegMap.<br class=""> extern char &VirtRegRewriterID;<br class=""><br class="">Modified: llvm/trunk/include/llvm/InitializePasses.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=304602&r1=304601&r2=304602&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=304602&r1=304601&r2=304602&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/InitializePasses.h (original)<br class="">+++ llvm/trunk/include/llvm/InitializePasses.h Fri Jun  2 17:46:26 2017<br class="">@@ -304,6 +304,7 @@ void initializeProcessImplicitDefsPass(P<br class="">void initializeProfileSummaryInfoWrapperPassPass(PassRegistry&);<br class="">void initializePromoteLegacyPassPass(PassRegistry&);<br class="">void initializePruneEHPass(PassRegistry&);<br class="">+void initializeRABasicPass(PassRegistry &);<br class=""></blockquote><span 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-stroke-width: 0px; float: none; display: inline !important;" class="">There's 100 declarations around this that do not have a space after PassRegistry :)</span><br 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-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>clang-format’s doing. I’ll fix that.</div><br class=""><blockquote type="cite" class=""><div class=""><br 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-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="">void initializeRAGreedyPass(PassRegistry&);<br class="">void initializeReassociateLegacyPassPass(PassRegistry&);<br class="">void initializeRegBankSelectPass(PassRegistry&);<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/CodeGen.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=304602&r1=304601&r2=304602&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=304602&r1=304601&r2=304602&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/CodeGen.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/CodeGen.cpp Fri Jun  2 17:46:26 2017<br class="">@@ -77,6 +77,7 @@ void llvm::initializeCodeGen(PassRegistr<br class=""> initializePostRASchedulerPass(Registry);<br class=""> initializePreISelIntrinsicLoweringLegacyPassPass(Registry);<br class=""> initializeProcessImplicitDefsPass(Registry);<br class="">+  initializeRABasicPass(Registry);<br class=""> initializeRAGreedyPass(Registry);<br class=""> initializeRegisterCoalescerPass(Registry);<br class=""> initializeRenameIndependentSubregsPass(Registry);<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=304602&r1=304601&r2=304602&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=304602&r1=304601&r2=304602&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Fri Jun  2 17:46:26 2017<br class="">@@ -121,17 +121,24 @@ char RABasic::ID = 0;<br class=""><br class="">} // end anonymous namespace<br class=""><br class="">+char &llvm::RABasicID = RABasic::ID;<br class="">+<br class="">+INITIALIZE_PASS_BEGIN(RABasic, "regallocbasic", "Basic Register Allocator",<br class="">+                      false, false)<br class="">+INITIALIZE_PASS_DEPENDENCY(LiveDebugVariables)<br class="">+INITIALIZE_PASS_DEPENDENCY(SlotIndexes)<br class="">+INITIALIZE_PASS_DEPENDENCY(LiveIntervals)<br class="">+INITIALIZE_PASS_DEPENDENCY(RegisterCoalescer)<br class="">+INITIALIZE_PASS_DEPENDENCY(MachineScheduler)<br class="">+INITIALIZE_PASS_DEPENDENCY(LiveStacks)<br class="">+INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)<br class="">+INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)<br class="">+INITIALIZE_PASS_DEPENDENCY(VirtRegMap)<br class="">+INITIALIZE_PASS_DEPENDENCY(LiveRegMatrix)<br class=""></blockquote><span 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-stroke-width: 0px; float: none; display: inline !important;" class="">getAnalysisUsage() also mentions:</span><br 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-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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">- AAResultsWrapperPass</span><br 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-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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">- MachineBlockFrequencyInfo</span><br 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-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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">though I always wonder what that specification is good for because I never saw an error when I got it wrong…</span></div></blockquote><div><br class=""></div><div>Me too :S.</div><div>I did what we do for greedy, which was pulling only the one with an explicit call to initializeXXX</div><br class=""><blockquote type="cite" class=""><div class=""><br 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-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="">+INITIALIZE_PASS_END(RABasic, "regallocbasic", "Basic Register Allocator", false,<br class="">+                    false)<br class="">+<br class="">RABasic::RABasic(): MachineFunctionPass(ID) {<br class="">-  initializeLiveDebugVariablesPass(*PassRegistry::getPassRegistry());<br class="">-  initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());<br class="">-  initializeSlotIndexesPass(*PassRegistry::getPassRegistry());<br class="">-  initializeRegisterCoalescerPass(*PassRegistry::getPassRegistry());<br class="">-  initializeMachineSchedulerPass(*PassRegistry::getPassRegistry());<br class="">-  initializeLiveStacksPass(*PassRegistry::getPassRegistry());<br class="">-  initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry());<br class="">-  initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry());<br class="">-  initializeVirtRegMapPass(*PassRegistry::getPassRegistry());<br class="">-  initializeLiveRegMatrixPass(*PassRegistry::getPassRegistry());<br class="">}<br class=""><br class="">void RABasic::getAnalysisUsage(AnalysisUsage &AU) const {<br class=""><br class="">Modified: llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir?rev=304602&r1=304601&r2=304602&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir?rev=304602&r1=304601&r2=304602&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir (original)<br class="">+++ llvm/trunk/test/CodeGen/MIR/Generic/runPass.mir Fri Jun  2 17:46:26 2017<br class="">@@ -1,4 +1,5 @@<br class=""># RUN: llc -run-pass=greedy -debug-pass=Arguments -o - %s | FileCheck %s<br class="">+# RUN: llc -run-pass=regallocbasic -debug-pass=Arguments -o - %s | FileCheck %s<br class=""><br class=""># Check that passes are initialized correctly, so that it's possible to<br class=""># use -run-pass.<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</blockquote></div></blockquote></div><br class=""></body></html>