[all-commits] [llvm/llvm-project] de6fad: [TableGen][NFCI] Simplify TypeSetByHwMode::interse...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Wed Feb 14 20:02:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de6fad51462bd0784beafef6fd171ad7725205b5
      https://github.com/llvm/llvm-project/commit/de6fad51462bd0784beafef6fd171ad7725205b5
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

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

  Log Message:
  -----------
  [TableGen][NFCI] Simplify TypeSetByHwMode::intersect and make extensible (#81688)

The current implementation considers both iPTR+iN and everything else
all in one go, which leads to more special casing when iPTR is present
in only one set than is described in the comment block. Moreover this
makes it very difficult to add any new iPTR-like wildcards due to the
exponential combinatorial explosion that occurs.

Logically, iPTR+iN handling is entirely independent from everything
else, so rewrite the code to do them separately. This removes special
cases, making the core of the implementation more succinct, whilst more
clearly implementing exactly what is described in the comment block, and
allows for any number of (non-overlapping) wildcards to be added to the
list, as needed by CHERI LLVM downstream (due to having a new capability
type which, much like a normal integer pointer in LLVM, varies in size
between targets and modes).

In testing, this change results in identical TableGen output for all
in-tree backends (including those in LLVM_ALL_EXPERIMENTAL_TARGETS), and
it is intended that this implementation is entirely equivalent to the
old one.




More information about the All-commits mailing list