<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Type was merged incorrectly due to structure equality during llvm-link"
   href="https://bugs.llvm.org/show_bug.cgi?id=42993">42993</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Type was merged incorrectly due to structure equality during llvm-link
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llvm-link
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yuanting@ict.ac.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>reproduce: (Sorry for exceeding the file size limit)

Download <a href="https://github.com/timmyyuan/LLVMBugReport/blob/master/b065_go_.o.bc">https://github.com/timmyyuan/LLVMBugReport/blob/master/b065_go_.o.bc</a>
(765KB) and
<a href="https://github.com/timmyyuan/LLVMBugReport/blob/master/b069_go_.o.bc">https://github.com/timmyyuan/LLVMBugReport/blob/master/b069_go_.o.bc</a> (2.43M)

llvm-link b065_go_.o.bc b069_go_.o.bc -o output.bc
llvm-dis b069_go_.o.bc
llvm-dis output.bc

In b069_go_.o.ll, the second parameter type of function
"google.golang.org..z2fgrpc..z2finternal..z2ftransport.inFlow.maybeAdjust" is
%".google.golang.org/grpc/internal/transport.inFlow.0"*, which declared as

%".google.golang.org/grpc/internal/transport.inFlow.0" = type { %Mutex.0, i32,
i32, i32, i32 }
%Mutex.0 = type { i32, i32 }

but in output.ll, the second parameter type of this function is %RWMutex.0*,
which declared as

%RWMutex.0 = type { %Linger.0, i32, i32, i32, i32 }
%Linger.0 = type { i32, i32 }

If we reverse the link order, i.e.

llvm-link b069_go_.o.bc b065_go_.o.bc -o output.bc

the phenomenon above will disappear.

llvm-dis -version:
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
  LLVM version 10.0.0svn
  DEBUG build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: skylake

uname -a:
Linux yt 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019 x86_64
x86_64 x86_64 GNU/Linux

llvm last commit id:
cc611e1756a8601fc377ebf854d419de9db7d783</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>