[llvm] r247570 - [MergeFuncs] Fix bug in merging GetElementPointers
JF Bastien via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 11:13:19 PDT 2015
>
> GetElementPointers must have the first argument's type compared
>> for structural equivalence. Previously the code erroneously compared the
>> pointer's type, but this code was dead because all pointer types (of the
>> same address space) are the same. The pointee must be compared instead
>> (using the type stored in the GEP, not from the pointer type which will
>> be erased anyway).
>>
>
> Thanks so much for being aware of this/using APIs that'll be forwards
> compatible with the eventual removal of typed pointers.
>
> Just in case: do you care about the GEP pointer operands address space (I
> assume not) or vector types (eg: a gep over a vector of pointers)? I assume
> not, but just checking - both those aspects of the pointer operand are
> still in the pointer operand's type, not in the source element type.
>
We do care about address spaces in general: we can't merge two functions if
they refer to different address spaces. I'm not sure that's what you're
asking for though: in the end we (roughly) only want to merge functions
that would codegen to the same code. I think the same applies to your
vector of pointers question?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150914/1a50bce0/attachment.html>
More information about the llvm-commits
mailing list