[llvm] [AArch64] Use pattern to select bf16 fpextend (PR #137212)
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Thu May 1 08:17:05 PDT 2025
john-brawn-arm wrote:
> When there is just one instruction being generate it looks OK, it's only the noneon patterns that worry me and those are of less importance overall. (i.e. this sounds ok, but...) As far as I can see this won't currently work without +bf16, as it relies on seeing the `fpext(fpround())` after legalization, and the fpround will equally be expanded. It is a lot more code, emitting it with a pattern sounds unreasonable but did you give it any thought?
I'll have a look at this and see if there's anything we can do.
> (Would it be possible to have the fpext(fpround) optimization happen as part of getNode(), so that it happens almost immediately and doesn't have the requirement that the fpround and fpext are legal operations?)
It looks like this doesn't work, as the fpext/fpround are introduced during legalization which happens from the bottom up, so at the time the fpext is created the fpround doesn't exist yet.
https://github.com/llvm/llvm-project/pull/137212
More information about the llvm-commits
mailing list