[PATCH] D83389: [MIR] Speedup parsing (up to 1000x+)
Eugene Leviant via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 8 05:38:24 PDT 2020
evgeny777 created this revision.
evgeny777 added reviewers: arphaman, arsenm, Eugene.Zelenko, qcolombet.
Herald added subscribers: dexonsmith, hiraditya, wdng.
Herald added a project: LLVM.
Patch eliminates string length calculation when lexing a token. It lowers parsing time from 15 minutes to few seconds for 4MB MIR file on Ryzen7 4800H
https://reviews.llvm.org/D83389
Files:
llvm/lib/CodeGen/MIRParser/MIParser.cpp
Index: llvm/lib/CodeGen/MIRParser/MIParser.cpp
===================================================================
--- llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -563,7 +563,7 @@
void MIParser::lex(unsigned SkipChar) {
CurrentSource = lexMIToken(
- CurrentSource.data() + SkipChar, Token,
+ CurrentSource.slice(SkipChar, StringRef::npos), Token,
[this](StringRef::iterator Loc, const Twine &Msg) { error(Loc, Msg); });
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83389.276389.patch
Type: text/x-patch
Size: 491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200708/fbe6ed2f/attachment.bin>
More information about the llvm-commits
mailing list