[llvm-dev] Why Clang is yielding different LLVM IR return type for the same function

Zhang via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 2 20:48:01 PDT 2018


Hi:
So I have a library function called fooo() in a source file B.c and an external A.c file that is referencing a function fooo() in it.
foo is returning a pointer to a structure


A.ll:
%struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* }
declare i8* @fooo() #2


B.ll:
%struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* }
define noalias %struct._bar* @fooo() #2{
   ..........
}





I am implementing a transform pass that operates on the merged version of A.ll and B.ll , since they have different implementations llvm-link is inserting extra bitcasts and thus various passes failed to operate, for example the Inliner pass.
Is there anything else I could do to achieve what I need? Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180703/f70af69b/attachment.html>


More information about the llvm-dev mailing list