about summary refs log tree commit diff
path: root/compiler/rustc_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-13 04:29:20 +0000
committerbors <bors@rust-lang.org>2021-12-13 04:29:20 +0000
commit4a7fb971c939d268abdbd0963cd45d046442f7af (patch)
treed1cd9ebedc0bac90d308fdd5f713a2e2384e62e6 /compiler/rustc_llvm
parentf7fd79ac1d485ab47b62146f6dafed4aad5d9c6d (diff)
parent94f08334e0839689ff1c959ffaefa4ca19bd26f5 (diff)
downloadrust-4a7fb971c939d268abdbd0963cd45d046442f7af.tar.gz
rust-4a7fb971c939d268abdbd0963cd45d046442f7af.zip
Auto merge of #91569 - erikdesjardins:vt-align, r=nikic
Attach range metadata to alignment loads from vtables

...because alignment is always nonzero[0].

This helps eliminate redundant runtime alignment checks, when a DST
is a field of a struct whose remaining fields have alignment 1.

Fixes #91438.

---
[0]:

The [reference](https://doc.rust-lang.org/reference/type-layout.html) says that alignment must be at least 1.

And in practice, the alignment field for all vtables is generated here: https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_middle/src/ty/vtable.rs#L68-L90 and is nonzero because [`Align::bytes()`](https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_target/src/abi/mod.rs#L547-L549) is always nonzero.
Diffstat (limited to 'compiler/rustc_llvm')
0 files changed, 0 insertions, 0 deletions