[PATCH] D17911: Bitcode reader: Inline readAbbreviatedField in readRecord and move the enclosing loop in each case (NFC)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 6 09:06:15 PST 2016


tejohnson added a subscriber: tejohnson.
tejohnson added a comment.

Nice improvement. Do you know how much this improves the overall parse time or compile time?


================
Comment at: lib/Bitcode/Reader/BitstreamReader.cpp:135
@@ -134,3 +134,3 @@
       for (; NumElts; --NumElts)
         skipAbbreviatedField(*this, EltEnc);
       continue;
----------------
Similar loop unswitching optimization could be done here, but presumably not as hot. Consider implementing here too for consistency?

================
Comment at: lib/Bitcode/Reader/BitstreamReader.cpp:209
@@ -208,3 +208,3 @@
             "Array element type has to be an encoding of a type");
       if (EltEnc.getEncoding() == BitCodeAbbrevOp::Array ||
           EltEnc.getEncoding() == BitCodeAbbrevOp::Blob)
----------------
Move these into the default case in your new switch below. Otherwise essentially checking for the error case multiple times.


http://reviews.llvm.org/D17911





More information about the llvm-commits mailing list