Skip to content

Commit

Permalink
Auto merge of #114350 - erikdesjardins:ident, r=tmiasko
Browse files Browse the repository at this point in the history
cg_llvm: stop identifying ADTs in LLVM IR

This is an extension of #94107. It may be a minor perf win.

Fixes #96242.

Now that we use opaque pointers, ADTs can no longer be recursive, so we
do not need to name them. Previously, this would be necessary if you had
a struct like

```rs
struct Foo(Box<Foo>, u64, u64);
```

which would be represented with something like

```ll
%Foo = type { %Foo*, i64, i64 }
```

which is now just

```ll
{ ptr, i64, i64 }
```

r? `@tmiasko`
  • Loading branch information
bors committed Aug 4, 2023
2 parents 098c1db + 1d7f728 commit 73dc6f0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_codegen_llvm/src/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ fn uncached_llvm_type<'a, 'tcx>(
}
Some(name)
}
// Use identified structure types for ADT. Due to pointee types in LLVM IR their definition
// might be recursive. Other cases are non-recursive and we can use literal structure types.
ty::Adt(..) => Some(String::new()),
_ => None,
};

Expand Down

0 comments on commit 73dc6f0

Please sign in to comment.