James Courtier-Dutton via llvm-dev
2021-May-19 12:50 UTC
[llvm-dev] Forcing llvm to not wrap two 32bit accesses into a single 64bit access
Hi,
I am working with a problem with an arm64 CPU that seems to have
problems with 64bit read/write operations to particular memory
regions.
If I wish to transfer 256 bytes to this region with:
uint8_t *src;
uint8_t *dest;
for (int n = 0; n < 256; n++) {
src[n] = dest[n];
}
Now, these are byte accesses, but LLVM optimisation might try to
convert them into 64 bit or wide data transfer instructions.
How do I ensure that the optimisation will only optimise to 32bit wide
instructions?
As it is only for specific memory regions, I don't wish to put the
restriction on the entire program.
Kind Regards
James
Tim Northover via llvm-dev
2021-May-19 14:00 UTC
[llvm-dev] Forcing llvm to not wrap two 32bit accesses into a single 64bit access
On Wed, 19 May 2021 at 13:51, James Courtier-Dutton via llvm-dev <llvm-dev at lists.llvm.org> wrote:> How do I ensure that the optimisation will only optimise to 32bit wide > instructions?The only way I can think of is by marking them volatile (and possibly hand-promoting to 32-bit if that matters to you). Or assembly of one form or another of course. Cheers. Tim.