On Fri, 25 Apr 2025 09:41:21 GMT, Jatin Bhateja <jbhat...@openjdk.org> wrote:
>> It does look attractive, but macro expansion-based solution requires JVM to >> internalize such operations and their properties. >> >> IMO a higher-level solution based on more generic JVM primitives would >> enable libraries to properly annotate their operations in Java >> bytecodes/class files, so C2 can perform such type of transformations >> without the need to intrinsify each individual operation first. (Think of >> [JDK-8218414](https://bugs.openjdk.org/browse/JDK-8218414) / >> [JDK-8347901](https://bugs.openjdk.org/browse/JDK-8347901) on steroids.) > > I agree, this is a typical graph transform which cannot be applied currently > because we are generating CallLeafVectorNode upfront during parsing, If we > prevent intrinsification then compiler will attempt inlining, generating a > much complex graph shape which may not be reducible. I don't see any insurmountable problems performing such transformations on chains of `CallLeafVector` nodes (or any other call nodes). But the missing piece is information about the algebraic properties of native functions JVM can't derive on its own. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24462#discussion_r2060898080