Forwarding two questions from Add 3 way compare <=> integer intrinsics to Langref by miguelraz · Pull Request #83227 · llvm/llvm-project · GitHub :
Intrinsic naming: I proposed llvm.ucmp and llvm.scmp here. The PR uses llvm.uthreecmp and llvm.sthreecmp. Wondering if anyone has strong opinions on what the name should be. (An even more explicit possibility would be llvm.uthreewaycmp.)
Types: I proposed using two type overloads, allowing to separately specify the return and the argument type. So you can have both i32 @llvm.ucmp.i32.i32(i32, i32) and i8 @llvm.ucmp.i8.i32(i8, i8).
A possible alternative that came up is to instead specify a fixed return type. This could be something like i2 @llvm.ucmp.i32(i32, i32) if we’re fine with the illegal type, or i8 @llvm.ucmp.i32(i32, i32) if we want to stick to something byte-sized.
I think for the ISD opcodes we’d definitely want to have the result type overload, but for the IR intrinsic I’m not sure whether just fixing the type has any disadvantages. Wondering if anyone has thoughts on this.