-
Notifications
You must be signed in to change notification settings - Fork 15k
[RISCV] Add TuneNoDefaultUnroll to generic CPUs #135318
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-risc-v Author: Pengcheng Wang (wangpc-pp) ChangesAlmost all CPUs have added this. We may enable it by default and remove this feature. Fixes #134272. Full diff: https://github.com/llvm/llvm-project/pull/135318.diff 1 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVProcessors.td b/llvm/lib/Target/RISCV/RISCVProcessors.td
index 9d48adeec5e86..07a938db3e258 100644
--- a/llvm/lib/Target/RISCV/RISCVProcessors.td
+++ b/llvm/lib/Target/RISCV/RISCVProcessors.td
@@ -86,7 +86,8 @@ class RISCVTuneProcessorModel<string n,
list<SubtargetFeature> f = []>
: ProcessorModel<n, m, f,tunef>;
-defvar GenericTuneFeatures = [TuneOptimizedNF2SegmentLoadStore];
+defvar GenericTuneFeatures = [TuneOptimizedNF2SegmentLoadStore,
+ TuneNoDefaultUnroll];
def GENERIC_RV32 : RISCVProcessorModel<"generic-rv32",
NoSchedModel,
|
We got a net improvement in SPEC2017 on our out of order cores by using the default heuristic intead of That doesn't need to block this patch though. |
I've started a SPEC run on the BPI-F3 with this, I'll post the results soon |
Looks like this causes quite a few regressions on the BPI-F3, rva22u64_v -O3 -flto: https://lnt.lukelau.me/db_default/v4/nts/419 The code size increases are pretty big. Maybe the unrolling is too aggressive? |
Oops...This is surprising. I will do more investigations before we go back to this PR. |
It may be too aggressive for in-order cores. So I set the runtime unrolling count to 4 for in-order cores just like ARM and AArch64. Can you issue another run to see the effect? |
Almost all CPUs have added this. We may enable it by default and remove this feature. Fixes llvm#134272.
2677953
to
b45bf77
Compare
Gentle ping. :-) |
I can start a run tonight @wangpc-pp, I'll post the results tomorrow |
https://lnt.lukelau.me/db_default/v4/nts/665?compare_to=656 Some big regression in code size with rva22u64_v -O3 -flto. Only regression in exec time was 523.xalancbmk_r but we know that benchmark is usually noisy |
The code size regressions are expected, the performance has no observable change possibly because Spacemit X60 is just a dual-issues in-order core. |
I can run this PR on a VisionFive V2 that I have available if you'd like, but it doesn't have RVV. |
That'll be appreciated! |
Hi, I ran the tests this weekend on the visionfive2. This is SPEC built with |
Almost all CPUs have added this.
We may enable it by default and remove this feature.
Fixes #134272.