diff options
author | Felipe Magno de Almeida <felipe.m.almeida@gmail.com> | 2024-11-27 18:31:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-27 13:31:39 -0800 |
commit | e3fdc3aa81c7e8196d804fbde1a3f76796dbd5dd (patch) | |
tree | 729ddb044cda94af1783a8df2fd21a8ab36e402e /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | febbf9105f7101d7124e802e87d8303237b64a80 (diff) | |
download | llvm-e3fdc3aa81c7e8196d804fbde1a3f76796dbd5dd.zip llvm-e3fdc3aa81c7e8196d804fbde1a3f76796dbd5dd.tar.gz llvm-e3fdc3aa81c7e8196d804fbde1a3f76796dbd5dd.tar.bz2 |
[RISCV] Allow hoisting VXRM writes out of loops speculatively (#110044)
Change the intersect for the anticipated algorithm to ignore unknown
when anticipating. This effectively allows VXRM writes speculatively
because it could do a VXRM write even when there's branches where VXRM
is unneeded.
The importance of this change is because VXRM writes causes pipeline
flushes in some micro-architectures and so it makes sense to allow more
aggressive hoisting even if it causes some degradation for the slow
path.
An example is this code:
```
typedef unsigned char uint8_t;
__attribute__ ((noipa))
void foo (uint8_t *dst, int i_dst_stride,
uint8_t *src1, int i_src1_stride,
uint8_t *src2, int i_src2_stride,
int i_width, int i_height )
{
for( int y = 0; y < i_height; y++ )
{
for( int x = 0; x < i_width; x++ )
dst[x] = ( src1[x] + src2[x] + 1 ) >> 1;
dst += i_dst_stride;
src1 += i_src1_stride;
src2 += i_src2_stride;
}
}
```
With this patch, the code above generates a hoisting VXRM writes out of
the outer loop.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions