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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 10:55:39 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;
----------------
Artem-B wrote:

I'm fine with -1 as the representation of the bool true, but I also don't want it to become a showstopper for existing LLVM users. Existing CUDA code loves to bitcast things rather indiscriminately. Bitcasting between char/*int8_t/bool happens. I'm not saying that all of them are valid, but they do happen, and this change will affect them.
Perhaps it will be fine, but there's also a non-zero chance that I'll have users that will complain and we would not be able to debug and fix their stuff quickly.

We can land the patch as is. If the issues pop-up, we can revert and then rework it to make it a noop for in memory representation of bools. Or we can make it noop up-front if it's relatively easy, and address this issue separately.

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


More information about the llvm-commits mailing list