-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[LV][AArch64] Prefer epilogue with fixed-width over scalable VF in case of equal costs. #155546
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 all commits
8a7e6d6
fe9ad8d
2d247d0
6fcd32a
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 |
---|---|---|
|
@@ -6022,9 +6022,15 @@ static bool containsDecreasingPointers(Loop *TheLoop, | |
return false; | ||
} | ||
|
||
bool AArch64TTIImpl::preferFixedOverScalableIfEqualCost() const { | ||
bool AArch64TTIImpl::preferFixedOverScalableIfEqualCost(bool IsEpilogue) const { | ||
if (SVEPreferFixedOverScalableIfEqualCost.getNumOccurrences()) | ||
return SVEPreferFixedOverScalableIfEqualCost; | ||
// For cases like post-LTO vectorization, when we eventually know the trip | ||
// count, epilogue with fixed-width vectorization can be deleted if the trip | ||
// count is less than the epilogue iterations. That's why we prefer | ||
// fixed-width vectorization in epilogue in case of equal costs. | ||
if (IsEpilogue) | ||
|
||
return true; | ||
return ST->useFixedOverScalableIfEqualCost(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ target triple = "aarch64-unknown-linux-gnu" | |
define void @foo(ptr noalias nocapture readonly %p, ptr noalias nocapture %q, i64 %len) #0 { | ||
; CHECK-EPILOG: vec.epilog.ph: | ||
; CHECK-EPILOG: vec.epilog.vector.body: | ||
; CHECK-EPILOG: load <vscale x 4 x i16> | ||
; CHECK-EPILOG: load <8 x i16> | ||
|
||
|
||
; The epilogue loop gets vectorised vscale x 2 x i16 wide. | ||
; CHECK-EPILOG-V2: vec.epilog.ph: | ||
|
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.
should be documented