AliasInfo for MachineMemOperands

Hi,

when looking at the available Alias Information after lowering,

it seems that the expansion of ‘llvm.memcpy.p0i8.p0i8.i32’ (and variants) onto

load/store machine instructions is resulting in load/stores for which no AAInfo is available in the MachineMemOperand.

Because of this we need to assume that they may alias with anything… This is painful if these copies come from copying smaller structs around…

Would the correct solution here be to propagate the tbaa ref on the intrinsic to the load/stores ? Or are there still more subtle dangers (like having a Value in the MachineMemOperand that does not relate to anything ?)

Greetings,

From: "Jeroen Dobbelaere" <jeroen.dobbelaere@gmail.com>
To: LLVMdev@cs.uiuc.edu
Sent: Wednesday, February 4, 2015 9:47:31 AM
Subject: [LLVMdev] AliasInfo for MachineMemOperands

Hi,

when looking at the available Alias Information after lowering,
it seems that the expansion of 'llvm.memcpy.p0i8.p0i8.i32' (and
variants) onto
load/store machine instructions is resulting in load/stores for which
no AAInfo is available in the MachineMemOperand.

Because of this we need to assume that they may alias with
anything... This is painful if these copies come from copying
smaller structs around..

Would the correct solution here be to propagate the tbaa ref on the
intrinsic to the load/stores ? Or are there still more subtle
dangers (like having a Value in the MachineMemOperand that does not
relate to anything ?)

I don't see any reason why that should be problematic. You can use the base operand as the Value*, we just need to make sure that we set the size and offset correctly for each of the instructions in the expansion.

-Hal