[flang-commits] [flang] [flang] Fix ppc64le-flang-rhel-test buildbot failure (PR #142269)
Cameron McInally via flang-commits
flang-commits at lists.llvm.org
Sun Jun 1 18:53:55 PDT 2025
https://github.com/mcinally updated https://github.com/llvm/llvm-project/pull/142269
>From 5520865bf718b0d195b02f7a35008c92bb3999a2 Mon Sep 17 00:00:00 2001
From: Cameron McInally <cmcinally at nvidia.com>
Date: Sat, 31 May 2025 05:07:01 -0700
Subject: [PATCH 1/3] [flang] Fix ppc64le-flang-rhel-test buildbot failure
PR#142073 introduced a new test that checks the
prefer-vector-width function attribute. This test was not
accounting for target triples that include default function
attributes.
This patch updates prefer-vector-width.f90 to ignore extra
function attributes.
---
flang/test/Driver/prefer-vector-width.f90 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/flang/test/Driver/prefer-vector-width.f90 b/flang/test/Driver/prefer-vector-width.f90
index d0f5fd28db826..0e334f5f3e66e 100644
--- a/flang/test/Driver/prefer-vector-width.f90
+++ b/flang/test/Driver/prefer-vector-width.f90
@@ -9,8 +9,8 @@
subroutine func
end subroutine func
-! CHECK-DEF-NOT: attributes #0 = { "prefer-vector-width"={{.*}} }
-! CHECK-NONE: attributes #0 = { "prefer-vector-width"="none" }
-! CHECK-128: attributes #0 = { "prefer-vector-width"="128" }
-! CHECK-256: attributes #0 = { "prefer-vector-width"="256" }
+! CHECK-DEF-NOT: attributes #0 = { {{.*}}"prefer-vector-width"={{.*}} }
+! CHECK-NONE: attributes #0 = { {{.*}}"prefer-vector-width"="none"{{.*}} }
+! CHECK-128: attributes #0 = { {{.*}}"prefer-vector-width"="128"{{.*}} }
+! CHECK-256: attributes #0 = { {{.*}}"prefer-vector-width"="256"{{.*}} }
! CHECK-INVALID:error: invalid value 'xxx' in '-mprefer-vector-width=xxx'
>From 8f77f2e52c4271a3270ca12e9853fa0757fe1fe2 Mon Sep 17 00:00:00 2001
From: Cameron McInally <cmcinally at nvidia.com>
Date: Sun, 1 Jun 2025 05:33:49 -0700
Subject: [PATCH 2/3] [flang] Update prefer-vector-width.f90 to use CHECK-SAME
This patch updates prefer-vector-width.f90 to use CHECK-SAME
directives, rather than explicit wildcard regex expressions.
---
flang/test/Driver/prefer-vector-width.f90 | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/flang/test/Driver/prefer-vector-width.f90 b/flang/test/Driver/prefer-vector-width.f90
index 0e334f5f3e66e..8d8153d703e6f 100644
--- a/flang/test/Driver/prefer-vector-width.f90
+++ b/flang/test/Driver/prefer-vector-width.f90
@@ -1,16 +1,18 @@
! Test that -mprefer-vector-width works as expected.
! RUN: %flang_fc1 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-DEF
-! RUN: %flang_fc1 -mprefer-vector-width=none -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONE
-! RUN: %flang_fc1 -mprefer-vector-width=128 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-128
-! RUN: %flang_fc1 -mprefer-vector-width=256 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-256
-! RUN: not %flang_fc1 -mprefer-vector-width=xxx -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-INVALID
+! RUN: %flang_fc1 -mprefer-vector-width=none -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=CHECK,CHECK-NONE
+! RUN: %flang_fc1 -mprefer-vector-width=128 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=CHECK,CHECK-128
+! RUN: %flang_fc1 -mprefer-vector-width=256 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=CHECK,CHECK-256
+! RUN: not %flang_fc1 -mprefer-vector-width=xxx -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=CHECK-INVALID
subroutine func
end subroutine func
-! CHECK-DEF-NOT: attributes #0 = { {{.*}}"prefer-vector-width"={{.*}} }
-! CHECK-NONE: attributes #0 = { {{.*}}"prefer-vector-width"="none"{{.*}} }
-! CHECK-128: attributes #0 = { {{.*}}"prefer-vector-width"="128"{{.*}} }
-! CHECK-256: attributes #0 = { {{.*}}"prefer-vector-width"="256"{{.*}} }
+! CHECK: define {{.+}} @func{{.*}} #[[ATTRS:[0-9]+]]
+! CHECK: attributes #[[ATTRS]] =
+! CHECK-DEF-NOT: "prefer-vector-width"
+! CHECK-NONE-SAME: "prefer-vector-width"="none"
+! CHECK-128-SAME: "prefer-vector-width"="128"
+! CHECK-256-SAME: "prefer-vector-width"="256"
! CHECK-INVALID:error: invalid value 'xxx' in '-mprefer-vector-width=xxx'
>From 108593279ce3def74cda7673f805c92a050df070 Mon Sep 17 00:00:00 2001
From: Cameron McInally <cmcinally at nvidia.com>
Date: Sun, 1 Jun 2025 06:36:03 -0700
Subject: [PATCH 3/3] [flang] Fix typo in
flang/test/Driver/prefer-vector-width.f90
Add necessary white-space.
---
flang/test/Driver/prefer-vector-width.f90 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/test/Driver/prefer-vector-width.f90 b/flang/test/Driver/prefer-vector-width.f90
index 8d8153d703e6f..2e378f19dc862 100644
--- a/flang/test/Driver/prefer-vector-width.f90
+++ b/flang/test/Driver/prefer-vector-width.f90
@@ -15,4 +15,4 @@ end subroutine func
! CHECK-NONE-SAME: "prefer-vector-width"="none"
! CHECK-128-SAME: "prefer-vector-width"="128"
! CHECK-256-SAME: "prefer-vector-width"="256"
-! CHECK-INVALID:error: invalid value 'xxx' in '-mprefer-vector-width=xxx'
+! CHECK-INVALID: error: invalid value 'xxx' in '-mprefer-vector-width=xxx'
More information about the flang-commits
mailing list