[llvm] [SelectionDAG][WIP] Move HwMode expansion from tablegen to SelectionISel. (PR #174471)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 13:16:06 PST 2026


arichardson wrote:

> > This looks really neat! In my [work adding RVY](https://github.com/arichardson/upstream-llvm-project/tree/2025-rvy-initial) (with yet another HWmode) I've so far been focused on adding assembly support and have not really started porting over the SelectionDAG changes, but I'll be sure to rebase it on top of this PR to check that all other RISC-V tests still pass (and eventually get to the SelectionDAG parts). Will report back once I've tested this.
> 
> I'd love to know how much the additional HwMode affects the size of the isel table without this patch.

I haven't tried with this change yet but here is the size with my added HWMode:
```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  27.2%  4.73Mi  37.9%  4.73Mi    (anonymous namespace)::RISCVInstructionSelector::getMatchTable()::MatchTable0
  25.8%  4.50Mi  36.1%  4.50Mi    llvm::RISCVDAGToDAGISel::SelectCode()::MatcherTable
```
Baseline is
```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  18.6%  2.39Mi  30.2%  2.39Mi    (anonymous namespace)::RISCVInstructionSelector::getMatchTable()::MatchTable0
  18.3%  2.34Mi  29.6%  2.34Mi    llvm::RISCVDAGToDAGISel::SelectCode()::MatcherTable
```

So I imagine with this change it will go from 4.73M to approximately 1.38M.

https://github.com/llvm/llvm-project/pull/174471


More information about the llvm-commits mailing list