[llvm-dev] Disabling llvm-link struct type merging

Henri Rosten via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 30 05:33:15 PDT 2020


Hello,

I notice llvm-link merges structurally identical struct types to avoid 
duplication. As an example, the following IR before llvm-link:

```
%struct.B = type { %struct.A }
%struct.A = type { void (i8*, i8*)* }
%struct.C = type { %struct.A }
```

becomes:

```
%struct.B = type { %struct.A }
%struct.A = type { void (i8*, i8*)* }
```

after running llvm-link: it drops struct.C since it has the same layout 
as struct.B.

Is there a way to tell llvm-link to _not_ merge structurally identical 
struct types and use the original struct types instead, even if it 
causes duplication in struct layouts?

Thanks,
-- Henri


More information about the llvm-dev mailing list