[llvm] [NVPTX] Merge consecutive elements while buffering constant vectors with sub-byte datatype. (PR #183628)
Durgadoss R via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 02:50:56 PST 2026
================
@@ -0,0 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; Test to verify that NVPTX backend correctly handles conversion of constant
+; global vectors containing sub-byte sized elements.
+
+; RUN: llc < %s -O0 -mtriple=nvptx64 -mcpu=sm_100a -mattr=+ptx86 | FileCheck %s
+; RUN: %if ptxas-sm_100a && ptxas-isa-8.6 %{ llc < %s -O0 -mtriple=nvptx64 -mcpu=sm_100a -mattr=+ptx86 | %ptxas-verify -arch=sm_100a %}
+
+target triple = "nvptx-nvidia-cuda"
+
+; CHECK: .visible .global .align 1 .b8 test0[1] = {33};
+ at test0 = local_unnamed_addr addrspace(1) constant <2 x i4> <i4 1, i4 2>, align 1
+
+define <2 x half> @foo() {
+; CHECK-LABEL: foo(
+; CHECK: {
+; CHECK-NEXT: .reg .b16 %rs<2>;
+; CHECK-NEXT: .reg .b32 %r<2>;
+; CHECK-EMPTY:
+; CHECK-NEXT: // %bb.0:
+; CHECK-NEXT: ld.global.b8 %rs1, [test0];
----------------
durga4github wrote:
okay, thanks for adding this test!
https://github.com/llvm/llvm-project/pull/183628
More information about the llvm-commits
mailing list