-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LV] Return Invalid from getLegacyCost when instruction cost forced. #154543
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
Changes from 1 commit
f1e98a6
e9ccb54
4b4d4a5
2f14b65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||
| ; REQUIRES: asserts | ||||||||||
| ; RUN: opt < %s -passes=loop-vectorize -force-target-instruction-cost=1 -debug-only=loop-vectorize -S -disable-output 2>&1 | FileCheck %s | ||||||||||
|
||||||||||
| target triple = "aarch64-linux-gnu" | ||||||||||
|
|
||||||||||
| define i32 @invalid_legacy_cost(i64 %N) #0 { | ||||||||||
| ; CHECK: LV: Checking a loop in 'invalid_legacy_cost | ||||||||||
| ; CHECK: LV: Found an estimated cost of Invalid for VF vscale x 2 For instruction: %0 = alloca i8, i64 0, align 16 | ||||||||||
|
||||||||||
| entry: | ||||||||||
| br label %for.body | ||||||||||
|
|
||||||||||
| for.body: | ||||||||||
| %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] | ||||||||||
| %0 = alloca i8, i64 0, align 16 | ||||||||||
|
||||||||||
| %arrayidx = getelementptr ptr, ptr null, i64 %iv | ||||||||||
|
||||||||||
| store ptr %0, ptr %arrayidx, align 8 | ||||||||||
| %iv.next = add i64 %iv, 1 | ||||||||||
| %exitcond.not = icmp eq i64 %iv, %N | ||||||||||
| br i1 %exitcond.not, label %for.end, label %for.body | ||||||||||
|
|
||||||||||
| for.end: | ||||||||||
| ret i32 0 | ||||||||||
|
||||||||||
| for.end: | |
| ret i32 0 | |
| for.end: | |
| ret void |
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.
This is not a fault with your patch, but it looks like it was already broken due to this:
I'm pretty sure it should be:
similar to
LoopVectorizationCostModel::expectedCostThere 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.
I think you're right, it should be
ForceTargetInstructionCost. I've updated this in the latest commit.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.
Yes, to test this we need a test that passes a large value, e.g.
-force-target-instruction-cost=100inllvm/test/Transforms/LoopVectorize/AArch64/force-target-instruction-cost.llwould do it