Nikita Popov bb75f655b0
[IRMover] Don't consider opaque types isomorphic to other types (#138241)
The type mapping in IRMover currently has a decent amount of complexity
related to establishing isomorphism between opaque struct types and
non-opaque struct types. I believe that this is both largely useless at
this point (after some recent clarifications, essentially the only place
where opaque types can still appear are external gobals) and has never
been entirely correct in the first place (because it does this in part
purely based on name rather than use, which means that we effectively
end up assigning semantics to the type name, which is illegal).

As such, I'd like to remove this functionality entirely.
2025-06-03 16:10:39 +02:00

27 lines
609 B
LLVM

; RUN: llvm-link %p/opaque.ll %p/Inputs/opaque.ll -S -o - | FileCheck %s
; CHECK-DAG: %A = type opaque
; CHECK-DAG: %A.0 = type {}
; CHECK-DAG: %B = type { %C, %C, ptr }
; CHECK-DAG: %B.1 = type { %D, %E, ptr }
; CHECK-DAG: %C = type { %A }
; CHECK-DAG: %D = type { %E }
; CHECK-DAG: %E = type opaque
; CHECK-DAG: @g1 = external global %B
; CHECK-DAG: @g2 = external global %A.0
; CHECK-DAG: @g3 = external global %B.1
; CHECK-DAG: getelementptr %A.0, ptr null, i32 0
%A = type opaque
%B = type { %C, %C, ptr }
%C = type { %A }
@g1 = external global %B
define ptr @use_g1() {
ret ptr @g1
}