[all-commits] [llvm/llvm-project] f92504: [TableGen] Move formation of MoveSiblingMatcher ea...

Craig Topper via All-commits all-commits at lists.llvm.org
Sat Feb 8 15:58:40 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9250401ef120a4605ad67bb43d3b25500900498
      https://github.com/llvm/llvm-project/commit/f9250401ef120a4605ad67bb43d3b25500900498
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2025-02-08 (Sat, 08 Feb 2025)

  Changed paths:
    M llvm/utils/TableGen/DAGISelMatcherOpt.cpp

  Log Message:
  -----------
  [TableGen] Move formation of MoveSiblingMatcher earlier in ContractNodes. NFC

ContractNodes recursively walks forward through a linked list. During
this recursion, Matchers are combined into other Matchers.

Previously the formation of MoveSiblingMatcher was after the
recursive call so it occurred as we were unwinding. If a
MoveSiblingMatcher was formed, we would recursively walk forward
to the end of the linked list again which isn't efficient.

To make this more efficient, move the formation of MoveSiblingMatcher
to the forward pass. Add additional rules to unfold MoveSiblingMatcher
if it would be more efficient to use CheckChildType, CheckChildInteger,
CheckChildSame, etc.

As an added benefit, this makes the function tail recursive which
the compiler can better optimize.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list