Fwd: [PATCH] Teach MergeFunctions about address spaces

Stepan Dyatkovskiy stpworld at narod.ru
Mon Sep 16 23:44:30 PDT 2013

Hi Matt,
Then, I think logic should be next:
1. In function definition (function type), we mark function types
'voo(i8*)' and 'voo2(i8 addrspace(1)*)' as equal.
2. While enumerating instructions in BBs: it depends on context should 
we ignore 'addrspace' or not.
2.1. In common case we mark 'inst0 i8*' and 'inst1 i8 addrspace(1)*' as 
2.2. In particular cases (inc, add, sub) we mark instructions as equal.

On output we get equal 'voo' and 'voo2' only in case if it uses pointer 
arithmetic only.


Matt Arsenault wrote:
> On 09/16/2013 12:24 PM, Stepan Dyatkovskiy wrote:
>> So, If I got right, it depends on what voo and voo2 does? If it
>> increments address - thats ok. If it loads/stores something - that
>> shouldn't be merged.
>> Denying everything that is not allowed, we deny to merge it in generic
>> case, but some functions still could me merged. Right?
>> -Stepan.
> That sounds right.

More information about the llvm-commits mailing list