<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE1v2zAM_TXOhYjh2PloDzmkLYoVGDagK7DjQFt0zFWRMn0k8H79KDtN2m7DDgMS2RLJJ_Lx0bVV_foLKt1n5S14Cy06YOjwQFATGYgGa00QLDR2RxD3cOTQAYKjvbMqNuTyrLjLis0Nem5Qj0ihIxC7hO6AzcHqA_nhsLVa2yOb7ZR9B6Hfk8-qzYiQLYvTb9yWCzaG3LfQQ1bdDc6QrW6AZ8t0x8ujKuX07hxjY_hTTFUm51eYv8e-vf6pI0eA8jcWrOTupOZWzkyTarGpHE-nEsaSe1BWvAP4zh4TV2xGJjTK28MjqLjbn-ga100ryQKaFDXtKUwNOmePpKbKHg14-hHTfWBboAOZkG4aI0OHQTpVk2axyE2NjkpqXRZ53cgKSrJzjJp_YmBrUi52j4I33Vs2cq2HnVX0wtvVsWNptEdWIAhwRC9sbT59fpL1r8Hl9TkhNCqVqNk8S3tTxggtHdOLj02X_KOmSwHcQm9j4seAALt-oCrRf-lhqsMHF5swdrLuwaDIUOwJdxAUG9Qn8DN2At5SeIf2L0Xk5WtNyNVZdTs9YZxVkzKSSUgNVnGvRfKB1JuefhDm0PShSzRofhaNdOzHcfJpqam1jrLqfvR_yMrVLlmS_-AqbHfSuMTvLdRSqyCehnLoD4vOjESF8QyFI2EftTUEOza8E0aG-YQmOhFs0H2e5xO1rtR1dY0TjKGzbv2RalJ0eHyYRKfXXQj7YRbLe_ltZcpjncvQy0brw8tjKqjfqQmyZe9j6uf9oprN55NuXRZl2WBB7WqhZstZWRXFVUtLtSquCqRiNdEocvXrbHGTleU7PclJtrib_H8ePORRzGazspwv5vO8WrT1VbOq63qJ9UxhNi9oh6zzhJNbt5249QBZx60Xo2Yf_MWI3vPWEA1pS4aBgx42bwsQE3wldtKdlM_4mZQWmsAtkzrJOLrTF0NEkNp9kdBkCFsPNfwCsofQGg>53144</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [opaque-pointer] Weird issue with identified structure types being duplicated
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            opaque-pointers
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          LebedevRI
      </td>
    </tr>
</table>

<pre>
    Sadly, so far i have been unable to come up with a reproducer.
Basically, the problem involves the following-ish types:
```
%inner_ty = type { i16, i16, i32 }
%outer_ty = type { i32, %inner_ty, i32 }
```
There are no other references to these types, they do not show up in the plain IR dump.

After an not-yet-narrowed-down sequence of events,
that i believe include `.bc` deserialization in opaque-pointers mode
(while said .bc was *NOT* in opaque-pointers mode),
and IR linking of a few of such modules,
if you then query the `%outer_ty` struct type by name out of the final module,
you get `%outer_ty = type { i32, %inner_ty.2, i32 }` <- `%inner_ty` somehow duplicated.

Has anything like this been seen before?
I'm seeing this in halide, but as i have said i don't have a standalone minimal repro currently...
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVNtu2zAM_Rr7hYiRyM7twQ9pg2IFhg3oBuxxkCw61qpImS4xvK8fZadJ220Y4Ei2SB7yHFIRVg71Fy71kLF78BZa7kBBx88IAtFANFxohGChsUeEeIJehQ44ODw5K2ODrsjm-2y-u-NeNVxPSKFDIDuFHkGZs9Vn9ONha7W2vTKHmfIdhOGEPit3E0K2ml-e6ZMtlTHovocBsnI_OkO2vgO1WKUcL1vJ6HR_jbEx_C2mZMn5FeafsW_Tf-3QIXD6GQuWanfEuaUz0yQuNtHxeKEwUR5AWvIO4DvbJ62UmZTQnN4en0DG4-ki17TuWioWuElRswHDzHDnbI9yJm1vwOPPmPKBbQHPaELKNEWGjgfqlECtyEKZGh0lcV3NC9HQCpKqc4pr9YsHZU2qxZ444c1OVhlK6-FoJb7otuk7RY32XEkgBOi5J7V2nz5_pfWfwWx7LYgbmShqZZ6pvaliDi326cXHpkv-UeONgGphsDHpY4CA3TBKleS_9TDx8MHFJkydFAMYTmNI9oQ7DpQyXF_Ar9gJ-IDhHdr_JqJgr2eCUmfl_eyCcZ2aVBHdhNRgGU-aRj6gfNPTD6QcN0PokgxaPdOMdMpP18mnRWBrHWblw-T_mLH1MVmS_-hKanfUuKTvPQjiSoiXSzn2R9GcGYoK0xknjUh9rq1BOCqjjqTIeD-hiY4GNuihKIpc1qXcllueBxU01tny7m1Ps-UevqFylMD7iNNNpypMUK1CeelEdJehJx6p4psKeXS67kI4jVeaPdBzIIgoCvrvoA-tzy_bjIr7gU2gzzEXjcXDslxUVd7VcrvcbNuKSdrkcsvLar7drFm7XaxF2SxWueY09T7VnzH2bizphGjkqmZzxuaLxYKxallVRblsxaZZCyFWXCwkz6o5HrnSRaqmsO6Qu3osTMSDJ6NWPvibkXuvDgZH0RI-j6Gzrv6IAiWenx7zkUU9UvgNvL66gg">