-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[LoopVectorize][NFC] Rewrite tests to check output of vplan cost model #113697
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 26 additions & 21 deletions
47
llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,59 @@ | ||
; REQUIRES: asserts | ||
; RUN: opt -mtriple=aarch64 -mattr=+sve \ | ||
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE4 | ||
; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE16 | ||
|
||
; RUN: opt -mtriple=aarch64 -mattr=+sve -mcpu=generic \ | ||
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE4 | ||
; RUN: | FileCheck %s --check-prefixes=GENERIC,VF-VSCALE16 | ||
|
||
; RUN: opt -mtriple=aarch64 -mcpu=neoverse-v1 \ | ||
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-V1,VF-VSCALE4 | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-V1,VF-VSCALE16 | ||
|
||
; RUN: opt -mtriple=aarch64 -mcpu=neoverse-n2 \ | ||
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-N2,VF-VSCALE4 | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-N2,VF-VSCALE16 | ||
|
||
; RUN: opt -mtriple=aarch64 -mcpu=neoverse-n2 \ | ||
; RUN: opt -mtriple=aarch64 -mcpu=neoverse-v2 \ | ||
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize < %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-N2,VF-VSCALE4 | ||
; RUN: | FileCheck %s --check-prefixes=NEOVERSE-V2,VF-16 | ||
|
||
; GENERIC: Cost for VF vscale x 2: 11 (Estimated cost per lane: 2.8) | ||
; GENERIC: Cost for VF vscale x 4: 11 (Estimated cost per lane: 1.4) | ||
; GENERIC: LV: Selecting VF: vscale x 16 | ||
|
||
; GENERIC: LV: Vector loop of width vscale x 2 costs: 3 (assuming a minimum vscale of 2). | ||
; GENERIC: LV: Vector loop of width vscale x 4 costs: 1 (assuming a minimum vscale of 2). | ||
; NEOVERSE-V1: Cost for VF vscale x 2: 11 (Estimated cost per lane: 2.8) | ||
; NEOVERSE-V1: Cost for VF vscale x 4: 11 (Estimated cost per lane: 1.4) | ||
; NEOVERSE-V1: LV: Selecting VF: vscale x 16 | ||
|
||
; NEOVERSE-V1: LV: Vector loop of width vscale x 2 costs: 3 (assuming a minimum vscale of 2). | ||
; NEOVERSE-V1: LV: Vector loop of width vscale x 4 costs: 1 (assuming a minimum vscale of 2). | ||
; NEOVERSE-N2: Cost for VF vscale x 2: 11 (Estimated cost per lane: 5.5) | ||
; NEOVERSE-N2: Cost for VF vscale x 4: 11 (Estimated cost per lane: 2.8) | ||
; NEOVERSE-N2: LV: Selecting VF: vscale x 16 | ||
|
||
; NEOVERSE-N2: LV: Vector loop of width vscale x 2 costs: 6 (assuming a minimum vscale of 1). | ||
; NEOVERSE-N2: LV: Vector loop of width vscale x 4 costs: 3 (assuming a minimum vscale of 1). | ||
; NEOVERSE-V2: Cost for VF vscale x 2: 11 (Estimated cost per lane: 5.5) | ||
; NEOVERSE-V2: Cost for VF vscale x 4: 11 (Estimated cost per lane: 2.8) | ||
; NEOVERSE-V2: LV: Selecting VF: 16 | ||
|
||
; VF-4: <4 x i32> | ||
; VF-VSCALE4: <16 x i32> | ||
; VF-16: <16 x i8> | ||
; VF-VSCALE16: <vscale x 16 x i8> | ||
davemgreen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
define void @test0(ptr %a, ptr %b, ptr %c) #0 { | ||
entry: | ||
br label %loop | ||
|
||
loop: | ||
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] | ||
%arrayidx = getelementptr inbounds i32, ptr %c, i64 %iv | ||
%0 = load i32, ptr %arrayidx, align 4 | ||
%arrayidx = getelementptr inbounds i8, ptr %c, i64 %iv | ||
%0 = load i8, ptr %arrayidx, align 4 | ||
%arrayidx2 = getelementptr inbounds i8, ptr %b, i64 %iv | ||
%1 = load i8, ptr %arrayidx2, align 4 | ||
%zext = zext i8 %1 to i32 | ||
%add = add nsw i32 %zext, %0 | ||
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %iv | ||
store i32 %add, ptr %arrayidx5, align 4 | ||
%add = add nsw i8 %0, %1 | ||
%arrayidx5 = getelementptr inbounds i8, ptr %a, i64 %iv | ||
store i8 %add, ptr %arrayidx5, align 4 | ||
%iv.next = add nuw nsw i64 %iv, 1 | ||
%exitcond.not = icmp eq i64 %iv.next, 1024 | ||
br i1 %exitcond.not, label %exit, label %loop | ||
|
||
exit: | ||
ret void | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would probably be convenient to have a simple helper for that as we do this in more and more places now?
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.
Good suggestion! I've created #116247