[llvm] Verifier: forbid non-i32/i64 lrint, and non-i64 llrint (PR #70839)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 12:14:38 PDT 2023


artagnon wrote:

> There's sort of an implicit contract that the scalar intrinsics would only be created by calls to the functions in C code so the types match the C type for long or long long which LLVM itself doesn't know about. If the target doesn't lower them to instructions we map them back to the C library call. That's why we maintain separate intrinsics for lrint and llrint so we can use the name to get back to the correct library call without LLVM knowing the size of long or long long.
> 
> Theoretically an out of tree target could have a 128 bit `long long` type.

I see: that makes sense, and I will close this PR. However, I don't quite understand the ISelLowering for different targets: when the LangRef says "not all targets may support all types, however", is the user expected to experience random crashes from SelectionDAG (these are pretty nasty) when they try to lower some unsupported type + call + target combination?

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


More information about the llvm-commits mailing list