[llvm] [AArch64][GlobalISel] Select UMULL instruction (PR #65469)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 07:29:31 PDT 2023


davemgreen wrote:

> > * Pretend all v2i64 mul are legal and do the legalization of them in AArch64PostLegalizerLowering? The rest of GlobalISel then might believe that v2s64 mul are legal.
> 
> This could actually work. Our definition of legal is that the instructions can be "selected", which is a somewhat fuzzier concept than just "`-run-pass=instruction-select` doesn't abort". An instruction doesn't have to have native instruction to be "legal", and our concept of "selection" basically means the mandatory post-legalization pipeline. So as long as the combination of PostLegalizationLowering + InstructionSelect can handle an operation, that to me makes the operation legal. I think this method feels cleaner architecturally to me than the others.

Yeah it might work OK. We can give it a try. My worry would be that `LegalityQuery->getAction({G_MUL, v2s64}).Action` would return Legal, and other operations or optimizations in the generic parts of GISel create them where they would not end up being legal. I'm not sure if there are many combines that would want to generate a MUL though, if it didn't start from a MUL already.

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


More information about the llvm-commits mailing list