[PATCH] D128299: [pseudo] Add a fast-path to GLR reduce when both pop and push are trivial

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 23 04:44:26 PDT 2022


hokein added inline comments.


================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:268
+  // However in trivial cases (only pop that yields only one push) we can
+  // bypass all these fancy queues and pop+push directly. This is very common.
+  auto PopAndPushTrivial = [&]() -> bool {
----------------
Thinking more about this, this trivial case seems to be triggered more often if we use a more powerful LR parsing algorithm -- a more powerful LR parser means less dead heads, and more linear cases.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128299/new/

https://reviews.llvm.org/D128299



More information about the cfe-commits mailing list