Repository navigation
Conversation
…tion's sources in different register banks
4 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Human comment:
vortexgpgpu/vortex#479
This makes register bank conflicts rare in the compiler to justify reducing the operand collector.
AI-generated comment:
Summary
Bank-aware register allocation hints for XVortex. The Vortex operand collector reads source registers from 4 single-ported banks, selected by the low two bits of the register number (x0 is not read). Two sources of one instruction in the same bank cost an extra read cycle. This change makes the register allocator prefer, for each virtual register, a physical register in a different bank from the other sources it is read with.
How it works (
RISCVRegisterInfo::getRegAllocationHints→addVortexBankHints):+xvortexand the base hints are not hard.-riscv-vortex-bank-hints=falseturns it off.It is a hint, not a constraint: the allocator still takes whatever is free, and no instruction count changes.
Results
Static count of instructions whose register sources share a bank (Vortex regression kernels as built by their Makefiles, XLEN 32):
The same register read twice (e.g.
fmul ft0, fa0, fa0) also conflicts, and no allocation can fix it. jacobi's remaining conflicts are in the prebuilt soft-double library calls.Cycles (rtlsim, 64 warps, 4 issue slices, 32 threads, 8 kernels): about −1% geomean with 2 or 4 operand collectors per issue slice (conv3 −4%), no change with 1 per slice.
Tests
llvm/test/CodeGen/RISCV/xvortex-bank-hints.ll: a stencil FMA chain, 3 same-bank source pairs before, 0 after.update_llc_test_checks.py; register names only (xvortex-group-bitcast,-group-extract-subvector,-group-i1-mem,-group-lanes,xvortex-wide-dag-merge,-wide-lsv-llc). With the option off they pass unchanged.vortex_3.x; none use+xvortex.