[llvm-commits] [llvm] r51636 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/memmove.ll

Chris Lattner clattner at apple.com
Wed May 28 16:33:16 PDT 2008


On May 28, 2008, at 11:41 AM, Duncan Sands wrote:

>> I guess the case that matters is when the CFE turns volatile struct
>> assignment into a memcpy.  We should probably add a isvolatile flag  
>> to
>> llvm.memcpy/memmove/memset just for completeness.
>
> How about just outputting an explicit loop in that case?
> Also, someone assigning volatile structs probably has
> wrong expectations anyway: memcpy may copy the struct
> a byte at a time while they are probably hoping for
> field-at-a-time.  For example they probably expect
> integer fields to be written using one processor
> operation (resulting in a consistent view of the
> integer from other processors) but that may not be what
> they get...

I'd rather just add an i1 argument to llvm.mem* indicating whether it  
is volatile or not.  I agree that people using this have dubious  
expectations, but adding the argument is simple and has clean semantics.

-Chris



More information about the llvm-commits mailing list