[llvm] [IRMover] Don't consider opaque types isomorphic to other types (PR #138241)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 01:54:34 PDT 2025


================

----------------
nikic wrote:

This test illustrates why the existing behavior is wrong. Inputs/type-unique-dst-types3.ll is:
```llvm
%A.11 = type opaque
@g2 = external global %A.11

define ptr @use_g2() {
  ret ptr @g2
}
```
And `@g2` is not mentioned by the other linked files. As such, LLVM IR semantics do not make any statement about the type (and thus size) of `@g2`. The fact that a `%A.11` type exists in a different module should be completely irrelevant in this context.

https://github.com/llvm/llvm-project/pull/138241


More information about the llvm-commits mailing list