<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llvm-tblgen for X86GenInstrInfo.inc.tmp takes a long time due to lots of instregex use"
   href="https://bugs.llvm.org/show_bug.cgi?id=35955">35955</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-tblgen for X86GenInstrInfo.inc.tmp takes a long time due to lots of instregex use
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In a highly-parallel build (-j250), full build time is limited by llvm-tblgen
taking 1 minute to generate X86GenInstrInfo.inc.tmp and
X86GenSubtargetInfo.inc.tmp each.


Command:

cd /Users/thakis/src/llvm-build-goma/lib/Target/X86 && time
/Users/thakis/src/llvm-build-goma/bin/llvm-tblgen -gen-instr-info -I
/Users/thakis/src/llvm-rw/lib/Target/X86 -I /Users/thakis/src/llvm-rw/include
-I /Users/thakis/src/llvm-rw/lib/Target
/Users/thakis/src/llvm-rw/lib/Target/X86/X86.td -o
/Users/thakis/src/llvm-build-goma/lib/Target/X86/X86GenInstrInfo.inc.tmp


Profile:

43.05 s  100.0% 0 s             llvm-tblgen (26142)
43.05 s  100.0% 0 s              Main Thread  0x7659e
43.05 s   99.9% 0 s               start
43.04 s   99.9% 0 s                main
43.04 s   99.9% 0 s                 llvm::TableGenMain(char*, bool
(*)(llvm::raw_ostream&, llvm::RecordKeeper&))
40.53 s   94.1% 0 s                  (anonymous
namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&)
40.53 s   94.1% 0 s                   llvm::EmitInstrInfo(llvm::RecordKeeper&,
llvm::raw_ostream&)
38.05 s   88.3% 0 s                    llvm::CodeGenTarget::getSchedModels()
const
38.05 s   88.3% 0 s                    
llvm::CodeGenSchedModels::CodeGenSchedModels(llvm::RecordKeeper&,
llvm::CodeGenTarget const&)
37.93 s   88.1% 3.00 ms                 
llvm::CodeGenSchedModels::collectSchedClasses()
37.88 s   87.9% 12.00 ms                         
llvm::CodeGenSchedModels::createInstRWClass(llvm::Record*)
37.85 s   87.9% 38.00 ms                          
llvm::SetTheory::expand(llvm::Record*)
37.77 s   87.7% 28.67 s                     (anonymous
namespace)::InstRegexOp::apply(llvm::SetTheory&, llvm::DagInit*,
llvm::SmallSetVector<llvm::Record*, 16u>&, llvm::ArrayRef<llvm::SMLoc>)
9.02 s   20.9%  1.45 s                      
llvm::Regex::match(llvm::StringRef, llvm::SmallVectorImpl<llvm::StringRef>*)
41.00 ms    0.0%        0 s                         
llvm::Regex::Regex(llvm::StringRef, unsigned int)



Looking through <a href="http://llvm-cs.pcc.me.uk/utils/TableGen/CodeGenSchedule.cpp#60">http://llvm-cs.pcc.me.uk/utils/TableGen/CodeGenSchedule.cpp#60</a>
and its callers on that stack suggests that reordering could help a lot here.

All the instregex calls are pretty new (r315175, r316492, etc); maybe you could
try to speed this up some?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>