[llvm-branch-commits] [llvm] release/20.x: [llvm][Hexagon] Promote operand v2i1 to v2i32 (#135409) (PR #135461)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Apr 15 17:22:43 PDT 2025


https://github.com/llvmbot updated https://github.com/llvm/llvm-project/pull/135461

>From 86f5891c5986a34ae2311bcfa9e4bf56b58f14e4 Mon Sep 17 00:00:00 2001
From: Ikhlas Ajbar <iajbar at quicinc.com>
Date: Fri, 11 Apr 2025 14:25:50 -0500
Subject: [PATCH] [llvm][Hexagon] Promote operand v2i1 to v2i32 (#135409)

Fixes #118879

(cherry picked from commit 32c39092eab3a401d9d028c21f4707102fd70e32)
---
 llvm/lib/Target/Hexagon/HexagonCallingConv.td |  1 +
 llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll

diff --git a/llvm/lib/Target/Hexagon/HexagonCallingConv.td b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
index 2378bbc928d49..e0302b85fa948 100644
--- a/llvm/lib/Target/Hexagon/HexagonCallingConv.td
+++ b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
@@ -65,6 +65,7 @@ def CC_Hexagon: CallingConv<[
   CCIfType<[i32],
     CCIfSplit<
       CCCustom<"CC_SkipOdd">>>,
+  CCIfType<[v2i1],  CCPromoteToType<v2i32>>,
   CCIfType<[v4i1],  CCPromoteToType<v4i16>>,
   CCIfType<[v8i1],  CCPromoteToType<v8i8>>,
 
diff --git a/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll b/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll
new file mode 100644
index 0000000000000..2dcd5fe571e36
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/calloperand-v2i1.ll
@@ -0,0 +1,14 @@
+;RUN: llc -mtriple=hexagon  < %s | FileCheck %s
+
+; Check that v2i1 type is promoted to v2i32.
+; CHECK: call f
+; CHECK: r{{[0-9]+}}:{{[0-9]+}} = memd(r29+#8)
+
+define  <2 x i1> @test(<2 x i1> %1) {
+Entry:
+   %2 = call <2 x i1> @f(<2 x i1> %1)
+  ret <2 x i1> %2
+
+  }
+
+declare <2 x i1> @f(<2 x i1>)



More information about the llvm-branch-commits mailing list