-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[flang] Fix ppc64le-flang-rhel-test buildbot failure #142269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
@llvm/pr-subscribers-flang-driver Author: Cameron McInally (mcinally) ChangesPR#142073 introduced a new test that checks the This patch updates prefer-vector-width.f90 to ignore extra function attributes. Full diff: https://github.com/llvm/llvm-project/pull/142269.diff 1 Files Affected:
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'
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix.
! 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"{{.*}} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps something like this might be safer. What do you think?
! RUN: %flang_fc1 -mprefer-vector-width=128 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=ALL,W128
! RUN: %flang_fc1 -mprefer-vector-width=128 -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefixes=ALL,W256
! ALL: define {{.+}} @func{{.*}} #[[ATTRS:[0-9]+]]
! ALL: attributes #[[ATTRS]] =
! W128-SAME: "prefer-vector-width"="128"
! W256-SAME: "prefer-vector-width"="256"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared a patch with a slight tweak to your solution, but the same general idea. It uses CHECK instead of ALL, since the negative tests won't fit in the ALL pattern.
This patch updates prefer-vector-width.f90 to use CHECK-SAME directives, rather than explicit wildcard regex expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick change. LGTM.
! 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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For consistency with the other check patterns.
! CHECK-INVALID:error: invalid value 'xxx' in '-mprefer-vector-width=xxx' | |
! CHECK-INVALID: error: invalid value 'xxx' in '-mprefer-vector-width=xxx' |
Add necessary white-space.
@tarunprabhu I still don't have commit access, so will need assistance merging. Also FYI that it appears someone has fixed the test already, but I've updated this patch to include our improvements anyway. |
I think the matches here are more robust, so I am ok with overriding the quick fix. |
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.