Revision tags: llvmorg-21-init |
|
#
0cb7636a |
| 28-Jan-2025 |
Djordje Todorovic <djordje.todorovic@htecgroup.com> |
[RISCV] Add MIPS extensions (#121394)
Adding two extensions for MIPS p8700 CPU:
1. cmove (conditional move)
2. lsp (load/store pair)
The official product page here:
https://mips.com/produc
[RISCV] Add MIPS extensions (#121394)
Adding two extensions for MIPS p8700 CPU:
1. cmove (conditional move)
2. lsp (load/store pair)
The official product page here:
https://mips.com/products/hardware/p8700
show more ...
|
Revision tags: llvmorg-19.1.7 |
|
#
2c782ab2 |
| 19-Dec-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Add software pipeliner support (#117546)
This patch adds basic support of `MachinePipeliner` and disable it by default. The functionality should be OK and all llvm-test-suite tests have
[RISCV] Add software pipeliner support (#117546)
This patch adds basic support of `MachinePipeliner` and disable it by default. The functionality should be OK and all llvm-test-suite tests have passed.
show more ...
|
#
169c32eb |
| 17-Dec-2024 |
Michael Maitland <michaeltmaitland@gmail.com> |
[RISCV][VLOPT] Enable the RISCVVLOptimizer by default (#119461)
Now that we have testing of all instructions in the isSupportedInstr
switch, and better coverage of getOperandInfo, I think it is a g
[RISCV][VLOPT] Enable the RISCVVLOptimizer by default (#119461)
Now that we have testing of all instructions in the isSupportedInstr
switch, and better coverage of getOperandInfo, I think it is a good time
to enable this by default.
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
3787fbf0 |
| 11-Dec-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] Enable merging of external globals by default (#117880)
This follows up #115495 by enabling merging of external globals by
default, which had been left as a next step in order to make the
[RISCV] Enable merging of external globals by default (#117880)
This follows up #115495 by enabling merging of external globals by
default, which had been left as a next step in order to make the
previous change more incremental and so we can more easily narrow down
on any identified regressions.
Enabling merging of external globals matches what Arm does (for non
mach-o targets), though AArch64 doesn't as there were [some
concerns](https://reviews.llvm.org/D61947) it might cause regressions in
some cases.
See https://github.com/llvm/llvm-project/pull/117880 for benchmark figures and discussion.
show more ...
|
#
708a478d |
| 10-Dec-2024 |
Raphael Moreira Zinsly <rzinsly@ventanamicro.com> |
[RISCV] Add stack clash protection (#117612)
Enable `-fstack-clash-protection` for RISCV and stack probe for function
prologues.
We probe the stack by creating a loop that allocates and probe the
[RISCV] Add stack clash protection (#117612)
Enable `-fstack-clash-protection` for RISCV and stack probe for function
prologues.
We probe the stack by creating a loop that allocates and probe the stack
in ProbeSize chunks.
We emit an unrolled probe loop for small allocations and emit a variable
length probe loop for bigger ones.
show more ...
|
Revision tags: llvmorg-19.1.5 |
|
#
01a15dca |
| 29-Nov-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Set a barrier between mask producer and user of V0 (#114012)
Here we add a scheduling mutation in pre-ra scheduling, which will add an artificial dependency edge between mask producer and it
[RISCV] Set a barrier between mask producer and user of V0 (#114012)
Here we add a scheduling mutation in pre-ra scheduling, which will add an artificial dependency edge between mask producer and its previous nearest instruction that uses V0 register.
This prevents the overlap of live intervals of mask registers and as a consequence we can reduce some spills/moves.
From the test changes, we can see some improvements and also some regressions (more vtype toggles).
Partially fixes #113489.
show more ...
|
Revision tags: llvmorg-19.1.4 |
|
#
9d02264b |
| 15-Nov-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] Enable global merging by default (#115495)
From the discussion at the round-table at the RISC-V Summit it was clear
people see cases where global merging would help. So the direction of
en
[RISCV] Enable global merging by default (#115495)
From the discussion at the round-table at the RISC-V Summit it was clear
people see cases where global merging would help. So the direction of
enabling it by default and iteratively working to enable it in more
cases or to improve the heuristics seems sensible. This patch tries to
make a minimal step in that direction.
show more ...
|
#
bb3f5e1f |
| 14-Nov-2024 |
Matin Raayai <30674652+matinraayai@users.noreply.github.com> |
Overhaul the TargetMachine and LLVMTargetMachine Classes (#111234)
Following discussions in #110443, and the following earlier discussions
in https://lists.llvm.org/pipermail/llvm-dev/2017-October/
Overhaul the TargetMachine and LLVMTargetMachine Classes (#111234)
Following discussions in #110443, and the following earlier discussions
in https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html,
https://reviews.llvm.org/D38482, https://reviews.llvm.org/D38489, this
PR attempts to overhaul the `TargetMachine` and `LLVMTargetMachine`
interface classes. More specifically:
1. Makes `TargetMachine` the only class implemented under
`TargetMachine.h` in the `Target` library.
2. `TargetMachine` contains target-specific interface functions that
relate to IR/CodeGen/MC constructs, whereas before (at least on paper)
it was supposed to have only IR/MC constructs. Any Target that doesn't
want to use the independent code generator simply does not implement
them, and returns either `false` or `nullptr`.
3. Renames `LLVMTargetMachine` to `CodeGenCommonTMImpl`. This renaming
aims to make the purpose of `LLVMTargetMachine` clearer. Its interface
was moved under the CodeGen library, to further emphasis its usage in
Targets that use CodeGen directly.
4. Makes `TargetMachine` the only interface used across LLVM and its
projects. With these changes, `CodeGenCommonTMImpl` is simply a set of
shared function implementations of `TargetMachine`, and CodeGen users
don't need to static cast to `LLVMTargetMachine` every time they need a
CodeGen-specific feature of the `TargetMachine`.
5. More importantly, does not change any requirements regarding library
linking.
cc @arsenm @aeubanks
show more ...
|
#
82d5dd28 |
| 12-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[RISCV] Remove unused includes (NFC) (#115814)
Identified with misc-include-cleaner.
|
#
ae4fc805 |
| 09-Nov-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] When using global merging, don't enable merging of external globals by default (#115484)
AArch64 left this disabled after seeing some cases of slightly worse
codegen that weren't tracked do
[RISCV] When using global merging, don't enable merging of external globals by default (#115484)
AArch64 left this disabled after seeing some cases of slightly worse
codegen that weren't tracked down, so I suggest as a path to
incrementally moving towards enable globals merging we follow suit, and
evaluate turning on later.
This patch disables merging of external globals, but also adds a flag to
override that. This reduces churn in test cases, simplifies benchmarking
runs, and this flag can be removed later.
A follow-on PR enables the globals merging pass by default (and as it's
based on this commit, merging of external globals is disabled just as
they are for AArch64).
show more ...
|
#
69d0bab8 |
| 06-Nov-2024 |
BoyaoWang430 <wangboyao@bytedance.com> |
[RISCV] Add load/store clustering in post machine schedule (#111504)
#73789 added load clustering and #73796 tried to add store clustering.
If post machine schedule is used, previous cluster of loa
[RISCV] Add load/store clustering in post machine schedule (#111504)
#73789 added load clustering and #73796 tried to add store clustering.
If post machine schedule is used, previous cluster of load/store which
formed in machine schedule may break. In order to solve this, add
load/sotre clustering to post machine schedule.
show more ...
|
#
97982a8c |
| 05-Nov-2024 |
dlav-sc <daniil.avdeev@syntacore.com> |
[RISCV][CFI] add function epilogue cfi information (#110810)
This patch adds CFI instructions in the function epilogue.
Before patch:
addi sp, s0, -32
ld ra, 24(sp) # 8-byte Folded Reload
ld s
[RISCV][CFI] add function epilogue cfi information (#110810)
This patch adds CFI instructions in the function epilogue.
Before patch:
addi sp, s0, -32
ld ra, 24(sp) # 8-byte Folded Reload
ld s0, 16(sp) # 8-byte Folded Reload
ld s1, 8(sp) # 8-byte Folded Reload
addi sp, sp, 32
ret
After patch:
addi sp, s0, -32
.cfi_def_cfa sp, 32
ld ra, 24(sp) # 8-byte Folded Reload
ld s0, 16(sp) # 8-byte Folded Reload
ld s1, 8(sp) # 8-byte Folded Reload
.cfi_restore ra
.cfi_restore s0
.cfi_restore s1
addi sp, sp, 32
.cfi_def_cfa_offset 0
ret
This functionality is already present in `riscv-gcc`, but it’s not in
`clang` and this slightly impairs the `lldb` debugging experience, e.g.
backtrace.
show more ...
|
Revision tags: llvmorg-19.1.3 |
|
#
0cbccb13 |
| 28-Oct-2024 |
Luke Lau <luke@igalia.com> |
[RISCV] Remove support for pre-RA vsetvli insertion (#110796)
Now that LLVM 19.1.0 has been out for a while with post-vector-RA
vsetvli insertion enabled by default, this proposes to remove the fla
[RISCV] Remove support for pre-RA vsetvli insertion (#110796)
Now that LLVM 19.1.0 has been out for a while with post-vector-RA
vsetvli insertion enabled by default, this proposes to remove the flag
that restores the old pre-RA behaviour so we only have one configuration
going forward.
That flag was mainly meant as a fallback in case users ran into issues,
but I haven't seen anything reported so far.
show more ...
|
Revision tags: llvmorg-19.1.2 |
|
#
db57fc4e |
| 14-Oct-2024 |
Luke Lau <luke@igalia.com> |
[RISCV][VLOPT] Fix passthru check in getOperandInfo (#112244)
If a pseudo has a passthru, I believe the first source operand will have
operand no 2, not 1.
|
#
2967e5f8 |
| 11-Oct-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] Enable store clustering by default (#73796)
Builds on #73789, enabling store clustering by default using the same
heuristic.
|
#
1c94388f |
| 11-Oct-2024 |
Michael Maitland <michaeltmaitland@gmail.com> |
[RISCV] Introduce VLOptimizer pass (#108640)
The purpose of this optimization is to make the VL argument, for
instructions that have a VL argument, as small as possible. This is
implemented by vis
[RISCV] Introduce VLOptimizer pass (#108640)
The purpose of this optimization is to make the VL argument, for
instructions that have a VL argument, as small as possible. This is
implemented by visiting each instruction in reverse order and checking
that if it has a VL argument, whether the VL can be reduced.
By putting this pass before VSETVLI insertion, we see three kinds of
changes to generated code:
1. Eliminate VSETVLI instructions
2. Reduce the VL toggle on VSETVLI instructions that also change vtype
3. Reduce the VL set by a VSETVLI instruction
The list of supported instructions is currently whitelisted for safety.
In the future, we could add more instructions to `isSupportedInstr` to
support even more VL optimization.
We originally wrote this pass because vector GEP instructions do not
take a VL, which leads us to emit code that uses VL=VLMAX to implement
GEP in the RISC-V backend. As a result, some of the vector instructions
will write to lanes, specifically between the intended VL and VLMAX,
that will never be read. As an alternative to this pass, we considered
adding a vector predicated GEP instruction, but this would not fit well
into the intrinsic type system since GEP has a variable number of
arguments, each with arbitrary types. The second approach we considered
was to put this pass after VSETVLI insertion, but we found that it was
more difficult to recognize optimization opportunities, especially
across basic block boundaries -- the data flow analysis was also a bit
more expensive and complex.
While this pass solves the GEP problem, we have expanded it to handle
more cases of VL optimization, and there is opportunity for the analysis
to be improved to enable even more optimization. We have a few follow up
patches to post, but figured this would be a good start.
---------
Co-authored-by: Craig Topper <craig.topper@sifive.com>
Co-authored-by: Kito Cheng <kito.cheng@sifive.com>
show more ...
|
#
9c15ff21 |
| 02-Oct-2024 |
Craig Topper <craig.topper@sifive.com> |
[RISCV][GISel] Add RISCVPassConfig::getCSEConfig() to match other targets. (#110755)
|
#
14c4f28e |
| 01-Oct-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] Enable load clustering by default (#73789)
We believe this is neutral or slightly better in the majority of cases.
|
Revision tags: llvmorg-19.1.1 |
|
#
9c5ad62e |
| 20-Sep-2024 |
Michael Maitland <michaeltmaitland@gmail.com> |
Revert "[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)"
This reverts commit 64972834c193632cbc47e54c0f0c721636b077e6.
Based on the discussions in #108991 that happened post
Revert "[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)"
This reverts commit 64972834c193632cbc47e54c0f0c721636b077e6.
Based on the discussions in #108991 that happened post merge, we have decided to remove this pass in favor of generating `RISCV::G_*` opcodes in the legalizer.
We may reconsider moving that code elsewhere in the future so that we can do a better job during generic combines. We don't feel that doing it in instruciton selection is the right decision today. Firstly, it requires us to manually do regbankselect on the newly introduced instructions. Secondly, it is more difficult to test since the test output will contain whatever `RISCV::G_*` instructions select to (instead of `RISCV::G_*`).
My personal opinion is that the legalizer pass can be split into an early legalizer and a late legalizer, both before regbankselect. The first legalizer would not introduce target specific generic opcodes and the generic combiner would run after it. The second legalizer would introduce the target specific generic opcodes. I think this approach is better than the lowerer because the legalizer guarantees that whatever we lower to is legal, and apparently because it is more performant at compared to the lowerer (although, I'm not sure how true this is).
show more ...
|
#
0ee10e94 |
| 19-Sep-2024 |
Alex Bradbury <asb@igalia.com> |
[RISCV] Add additional fence for amocas when required by recent ABI change (#101023)
A recent atomics ABI change / fix requires that for the "A6C" and A6S"
atomics ABIs (i.e. both of those supporte
[RISCV] Add additional fence for amocas when required by recent ABI change (#101023)
A recent atomics ABI change / fix requires that for the "A6C" and A6S"
atomics ABIs (i.e. both of those supported by LLVM currently), an
additional fence is inserted for an atomic_compare_exchange with seq_cst
failure ordering.
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/445>
This isn't trivial to support through the hooks used by AtomicExpandPass
because that pass assumes that when fences are inserted, the original
atomics ordering information can be removed from the instruction. Rather
than try to change and complicate that API, this patch implements the
needed fence insertion through a small special purpose pass.
show more ...
|
#
64972834 |
| 17-Sep-2024 |
Michael Maitland <michaeltmaitland@gmail.com> |
[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)
This is mostly a copy of the AArch64PostLegalizerLoweringPass, except it
removes all of the AArch64 combines.
This pass all
[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)
This is mostly a copy of the AArch64PostLegalizerLoweringPass, except it
removes all of the AArch64 combines.
This pass allows us to lower instructions after the generic
post-legalization combiner has had a chance to run.
We will be adding combines to this pass in future patches.
show more ...
|
Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
27a62ec7 |
| 18-Aug-2024 |
Philip Reames <preames@rivosinc.com> |
[LSR] Split the -lsr-term-fold transformation into it's own pass (#104234)
This transformation doesn't actually use any of the internal state of
LSR and recomputes all information from SCEV. Split
[LSR] Split the -lsr-term-fold transformation into it's own pass (#104234)
This transformation doesn't actually use any of the internal state of
LSR and recomputes all information from SCEV. Splitting it out makes
it easier to test.
Note that long term I would like to write a version of this transform
which *is* integrated with LSR's solver, but if that happens, we'll
just delete the extra pass.
Integration wise, I switched from using TTI to using a pass configuration
variable. This seems slightly more idiomatic, and means we don't run
the extra logic on any target other than RISCV.
show more ...
|
#
e80d8e1b |
| 08-Aug-2024 |
Yeting Kuo <46629943+yetingk@users.noreply.github.com> |
[RISCV] Insert simple landing pad before indirect jumps for Zicfilp. (#91860)
This patch is based on https://github.com/llvm/llvm-project/pull/91855.
This patch inserts simple landing pad
([pr])be
[RISCV] Insert simple landing pad before indirect jumps for Zicfilp. (#91860)
This patch is based on https://github.com/llvm/llvm-project/pull/91855.
This patch inserts simple landing pad
([pr])before indirct jumps. And this also make option
riscv-landing-pad-label influence this feature.
[pr]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/417
show more ...
|
#
9fb196b4 |
| 06-Aug-2024 |
Yeting Kuo <46629943+yetingk@users.noreply.github.com> |
[RISCV] Insert simple landing pad for taken address labels. (#91855)
This patch implements simple landing pad labels ([pr]). When Zicfilp
enabled, this patch inserts `lpad 0` at the beginning of ba
[RISCV] Insert simple landing pad for taken address labels. (#91855)
This patch implements simple landing pad labels ([pr]). When Zicfilp
enabled, this patch inserts `lpad 0` at the beginning of basic blocks
which are possible to be landed by indirect jumps.
This patch also supports option riscv-landing-pad-label to make users
cpable to set nonzero fixed labels. Using nonzero fixed label force
setting t2 before indirect jumps. It's less portable but more strict
than original implementation.
[pr]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/417
show more ...
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
15b41d20 |
| 22-Jul-2024 |
Christudasan Devadasan <christudasan.devadasan@amd.com> |
[CodeGen] change prototype of regalloc filter function (#93525)
[CodeGen] Change the prototype of regalloc filter function
Change the prototype of the filter function so that we can
filter not j
[CodeGen] change prototype of regalloc filter function (#93525)
[CodeGen] Change the prototype of regalloc filter function
Change the prototype of the filter function so that we can
filter not just by RegClass. We need to implement more
complicated filter based upon some other info associated
with each register.
Patch provided by: Gang Chen (gangc@amd.com)
show more ...
|