[clang] [llvm] [PowerPC] Remove SPE from triple in VSX test (PR #147184)

Guy David via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 12:49:04 PDT 2025


https://github.com/guy-david updated https://github.com/llvm/llvm-project/pull/147184

>From 3336929fcd243162d2063998a2624017e4e89143 Mon Sep 17 00:00:00 2001
From: Guy David <guyda96 at gmail.com>
Date: Sun, 6 Jul 2025 15:22:38 +0300
Subject: [PATCH] [PowerPC] Test SPE incompatibility with VSX

PPCSubtarget is not always initialized, depending on which passes are running,
and in our downstream fork, -enable-matrix is the default configuration
(regardless of whether matrix intrinsics are present in the IR), which triggers
a fatal error in builtins-ppc-fpconstrained.c.
---
 clang/test/CodeGen/PowerPC/builtins-ppc-fpconstrained.c | 2 +-
 llvm/test/CodeGen/PowerPC/spe-vsx-incompatibility.ll    | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 llvm/test/CodeGen/PowerPC/spe-vsx-incompatibility.ll

diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-fpconstrained.c b/clang/test/CodeGen/PowerPC/builtins-ppc-fpconstrained.c
index 838db02415fe5..b46fa9f2cf157 100644
--- a/clang/test/CodeGen/PowerPC/builtins-ppc-fpconstrained.c
+++ b/clang/test/CodeGen/PowerPC/builtins-ppc-fpconstrained.c
@@ -11,7 +11,7 @@
 // RUN: -S -ffp-exception-behavior=strict \
 // RUN: -o - %s | FileCheck --check-prefix=CHECK-ASM \
 // RUN: --check-prefix=FIXME-CHECK  %s
-// RUN: %clang_cc1 -triple powerpcspe -ffp-exception-behavior=strict \
+// RUN: %clang_cc1 -triple powerpc -ffp-exception-behavior=strict \
 // RUN: -target-feature +vsx -fexperimental-strict-floating-point -emit-llvm \
 // RUN: %s -o - | FileCheck --check-prefix=CHECK-CONSTRAINED %s
 
diff --git a/llvm/test/CodeGen/PowerPC/spe-vsx-incompatibility.ll b/llvm/test/CodeGen/PowerPC/spe-vsx-incompatibility.ll
new file mode 100644
index 0000000000000..06c8f9a3b4bb6
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/spe-vsx-incompatibility.ll
@@ -0,0 +1,8 @@
+; Adding -enable-matrix, which is disabled by default, forces the initialization
+; of the PPCSubtarget which verifies the incompatible CPU features.
+; RUN: not llc -mtriple=powerpcspe -mattr=+vsx -enable-matrix < %s 2>&1  | FileCheck %s
+
+; CHECK: SPE and traditional floating point cannot both be enabled
+define void @test() {
+    ret void
+}



More information about the llvm-commits mailing list