[llvm] [llvm:codegen] Add lowering to all intrinsics available in `math.h`. (PR #162825)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 07:08:13 PDT 2025


Ingo =?utf-8?q?Müller?= <ingomueller at google.com>,
Ingo =?utf-8?q?Müller?= <ingomueller at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162825 at github.com>


https://github.com/arsenm commented:

I'm not really sure why we have this utility in the first place. I thought this was used by FastISel, but that appears to not be the case (maybe it used to be?). 

Why would the interpreter use it? Surely the interpreter should just be directly calling the appropriate functions to implement the intrinsics? I'm not sure why it would do this extra step of converting to the libcall. This is also broken because it ignores vectors and most FP types.

This also isn't considering if RuntimeLibcallsInfo reports the function as available. If you wanted to test this in the most straightforward way, there should be a standalone utility pass.

I'm thinking we shouldn't have IntrinsicLowering at all. SPIRV uses this for bswap, but it really shouldn't. It should just use the normal legalizer 

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


More information about the llvm-commits mailing list