[llvm] [GISel][RISCV] Legalize `G_{U|S}DIVREM` (PR #93067)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 19:07:34 PDT 2024


dtcxzyw wrote:

> > Is there any good reason why it always generates separate lib calls for div and rem rather than a single line call for divrem?
> 
> The divrem expansion in GISel probably splits its into div and rem and then each get legalized separate.
> 
> It's very weird to me that GISel combiner creates DIVREM when it needs to be expanded. That's not what SelectionDAG does.

> It always folds div + rem pairs into divrem during pre-legalization. I tried to change isLegalOrBeforeLegalizer to isLegal but it produced worse codegen on AArch64.

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


More information about the llvm-commits mailing list