Skip to content
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

LoopVectorize/test: fix opt invocations with -march (NFC) #74462

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

artagnon
Copy link
Contributor

@artagnon artagnon commented Dec 5, 2023

opt accepts the -march command-line argument, but this argument only makes sense in conjunction with -mtriple. Fix a couple of tests under LoopVectorize that invoke opt with -march but without -mtriple, to avoid confusing users.

opt erroneously accepts the -march command-line argument, although this
argument has no effect. Fix a couple of tests under LoopVectorize that
invoke opt with this argument, to avoid confusing users.
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 5, 2023

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

Changes

opt erroneously accepts the -march command-line argument, although this argument has no effect. Fix a couple of tests under LoopVectorize that invoke opt with this argument, to avoid confusing users.


Full diff: https://github.com/llvm/llvm-project/pull/74462.diff

2 Files Affected:

  • (modified) llvm/test/Transforms/LoopVectorize/Hexagon/maximum-vf-crash.ll (+1-2)
  • (modified) llvm/test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll (+1-2)
diff --git a/llvm/test/Transforms/LoopVectorize/Hexagon/maximum-vf-crash.ll b/llvm/test/Transforms/LoopVectorize/Hexagon/maximum-vf-crash.ll
index 4c7a7d31c5e72..4966ddd299492 100644
--- a/llvm/test/Transforms/LoopVectorize/Hexagon/maximum-vf-crash.ll
+++ b/llvm/test/Transforms/LoopVectorize/Hexagon/maximum-vf-crash.ll
@@ -1,4 +1,4 @@
-; RUN: opt -march=hexagon -hexagon-autohvx -passes=loop-vectorize -S < %s 2>&1 | FileCheck %s
+; RUN: opt -mtriple=hexagon -hexagon-autohvx -passes=loop-vectorize -S < %s 2>&1 | FileCheck %s
 
 ; Check that we don't crash.
 
@@ -6,7 +6,6 @@
 ; CHECK: vector.body
 
 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
-target triple = "hexagon"
 
 ; Function Attrs: optsize
 define i32 @f() #0 {
diff --git a/llvm/test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll b/llvm/test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll
index 4ff7ad9ab4390..1ac556a2fda39 100644
--- a/llvm/test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll
+++ b/llvm/test/Transforms/LoopVectorize/Hexagon/minimum-vf.ll
@@ -1,4 +1,4 @@
-; RUN: opt -march=hexagon -passes=loop-vectorize -hexagon-autohvx -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s
+; RUN: opt -mtriple=hexagon -passes=loop-vectorize -hexagon-autohvx -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s
 ; REQUIRES: asserts
 
 ; Check that TTI::getMinimumVF works. The calculated MaxVF was based on the
@@ -6,7 +6,6 @@
 ; CHECK: LV: Overriding calculated MaxVF({{[0-9]+}}) with target's minimum: 64
 
 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
-target triple = "hexagon"
 
 %s.0 = type { ptr, i32, i32, i32, i32 }
 

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

opt erroneously accepts the -march command-line argument, although this argument has no effect.

I don't think this is quite right. I believe -march will still be used when constructing the TargetMachine. But it is only meaningful in conjunction with a triple, and in the cases changed here it is entirely redundant.

@artagnon artagnon merged commit b0f560b into llvm:main Dec 8, 2023
5 checks passed
@artagnon artagnon deleted the lv-test-opt-march branch December 8, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants