aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2022-06-17 08:01:49 -0700
committerPhilip Reames <listmail@philipreames.com>2022-06-17 08:10:14 -0700
commit755c84c62cda80b0acf51ccc5653fc6d64536f7e (patch)
tree00ee71ae762ae841bba15e0e0dfe3d3efc09e265 /llvm/lib/CodeGen/MachineFunction.cpp
parent4a3a9a5fa0b2fd0e70672c35010fe2f00740f098 (diff)
downloadllvm-755c84c62cda80b0acf51ccc5653fc6d64536f7e.zip
llvm-755c84c62cda80b0acf51ccc5653fc6d64536f7e.tar.gz
llvm-755c84c62cda80b0acf51ccc5653fc6d64536f7e.tar.bz2
[RISCV] Avoid changing etype for splat of 0 or -1
A splat of the values 0 and -1 as sign extended 12 bit immediates are always the same bit pattern regardless of the etype used to perform the operation. As a result, we can sometimes avoid introducing a vsetvli just for the purposes of a splat. Looking at the diffs, we don't get a huge amount of immediate value out of this. We mostly push the vsetvli one instruction down, usually in front of a vmerge. We also don't get the corresponding fixed length vector cases because VL typically is changed despite the actual bits written being the same. Both of these are areas I plan to explore in future patches. Interestingly, this makes a great example of why we need the forward and backward implementation to be consistent. Before we merged the demanded field handling, if we implement only the forward direction, we lost the ability to mutate a prior vsetvli and eliminate a later one entirely. This resulted in practical regressions instead of improvements. It's always nice when practice matches theory. :) Differential Revision: https://reviews.llvm.org/D128006
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions