[llvm] [SDAG] Construct constants via instructions if materialization is costly (PR #86659)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 07:43:09 PDT 2024


RKSimon wrote:

> > Really not sure about this - why not just use custom lowering in the RISCV target?
> 
> I was thinking that maybe other targets can benefit from this.

Generic costs driven folds inside the DAG can get very difficult (how to compare them, quality of cost tables, different targets have different cost scales + thresholds, etc.) - I'd much prefer to see this just in RISCV (keep the costs system if you like). But really we should be considering better ways to ensure we reuse/rematerialize constants in a general manner, although I'd probably expect that to be later in ISelDAGToDAG etc.

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


More information about the llvm-commits mailing list