[llvm] [AArch64] Replace 64-bit MADD with [SU]MADDL when possible (PR #135926)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 03:35:26 PDT 2025


davemgreen wrote:

Do you have examples of where SDAG does not handle the mul->smull transform? Ideally it would be able to see the known bits even from different blocks in a lot of cases, but I can see this does help with SDAG. SDAG cannot see the known bits if it cannot generate blocks input blocks before the current block.

Ideally this kind of thing would be fixed by GISel, but it still feels a long way off, and I have thought of adding more to combine inside MIPeephole opt (mostly as I was experimenting with autogenerating peephole optimizations). I had come to the conclusion that inventing another place to do known-bits based transformations was likely not the best for maintenance and correctness though. Maybe it would be OK if we limit the scope.

(Most of the test cases are changing because GISel isn't able to import the relevant patterns. Some of those can be fixed by #136083, but some of the other patterns do not import because the PatLeafs are not imported at the moment).

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


More information about the llvm-commits mailing list