[llvm] [NVPTX] Fixup v2i8 parameter and return lowering (PR #145585)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 11:52:33 PDT 2025


================
@@ -14,7 +14,7 @@ define i1 @and_ord(float %a, float %b) {
 ; CHECK-NEXT:    ld.param.b32 %r1, [and_ord_param_0];
 ; CHECK-NEXT:    ld.param.b32 %r2, [and_ord_param_1];
 ; CHECK-NEXT:    setp.num.f32 %p1, %r1, %r2;
-; CHECK-NEXT:    selp.b32 %r3, 1, 0, %p1;
+; CHECK-NEXT:    selp.b32 %r3, -1, 0, %p1;
----------------
AlexMaclean wrote:

This change only impacts how `i1` return values are lowered, not the in-memory representation of these types in general. As far as I can tell, this would only be observable if someone were to say bitcast a function pointer to change the return type. Even then, it wouldn't be visible for a clang-cuda program as the front-end adds the `zeroext` attribute to parameters and return values, and this will force us to continue to use 1.

https://godbolt.org/z/x6odW4den

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


More information about the llvm-commits mailing list