Change addressing mode (byte to word)

Hi all,
we want to change the addressing mode for our target from bytes to words (8 bytes).

For the C code

long load64(long* a) {
    return a[5];

we get the following .ll code

%2 = getelementptr inbounds i64, i64* %0, i64 5
%3 = load i64, i64* %2, align 8, !tbaa !2

Compiling with our current solution we now get

ADDIL_64	VxR0, V0R2, #40
SMV_64	V0FIR0, VxR0
MV_64	V0R2, (V0FIR0)

Meaning we are loading what is at address 40 (word 5). The problem is, with our processor we need to load what is at address 5.
We tried dividing by 8 to get the right address but we are running into other issues with that approach.

Is there an easy way to change the addressing mode in llvm to words?
Is there another nice solution?
Any thoughts?

Not directly, but you can custom legalize your memory operations to scale the offsets. AMDGPU/R600 do this (although it’s not fully complete, and some edge cases may not work).