[llvm] r292461 - GlobalISel: Implement narrowing for G_LOAD

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 16:41:48 PST 2017


Pete Cooper <peter_cooper at apple.com> writes:
>> On Jan 18, 2017, at 5:05 PM, Justin Bogner via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> 
>> +
>> +    ; CHECK: [[OFFSET0:%[0-9]+]](s64) = G_CONSTANT i64 0
>> +    ; CHECK: [[GEP0:%[0-9]+]](p0) = G_GEP %0, [[OFFSET0]](s64)
>> +    ; CHECK: [[LOAD0:%[0-9]+]](s64) = G_LOAD [[GEP0]](p0) :: (load 16 from %ir.addr)
>> +    ; CHECK: [[OFFSET1:%[0-9]+]](s64) = G_CONSTANT i64 8
>> +    ; CHECK: [[GEP1:%[0-9]+]](p0) = G_GEP %0, [[OFFSET1]](s64)
>> +    ; CHECK: [[LOAD1:%[0-9]+]](s64) = G_LOAD [[GEP1]](p0) :: (load 16 from %ir.addr)
>> +    ; CHECK: %8(s128) = G_SEQUENCE [[LOAD0]](s64), 0, [[LOAD1]](s64), 64
>> +    %8(s128) = G_LOAD %0(p0) :: (load 16 from %ir.addr)
>
> Note sure if any clients of mem operands care, but you just copy the
> mem operand ("load 16") from the source instruction to the 2 new
> instructions.  This isn't correct as the 2 new instructions get "load
> 16" but should have "load 8".

This is conservatively correct as is, and if we want to be more specific
we'd need to do better than just "load 8", since %ir.addr wouldn't be
exactly right then. I've added a note about it in r292553.


More information about the llvm-commits mailing list