<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_ssa/src/mir/place.rs, branch 1.52.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.52.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.52.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-01-16T10:38:14+00:00</updated>
<entry>
<title>PlaceRef::ty: use method call syntax</title>
<updated>2021-01-16T10:38:14+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2021-01-16T10:34:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1b09dc2596c88dcf3fb840046f05db5e8595e9ca'/>
<id>urn:sha1:1b09dc2596c88dcf3fb840046f05db5e8595e9ca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #80200 - mahkoh:dst-offset, r=nagisa</title>
<updated>2021-01-07T03:13:21+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2021-01-07T03:13:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dfdfaa1f0442dac516ba87d274d832c00464b3c2'/>
<id>urn:sha1:dfdfaa1f0442dac516ba87d274d832c00464b3c2</id>
<content type='text'>
Optimize DST field access

For

    struct X&lt;T: ?Sized&gt;(T)
    struct Y&lt;T: ?Sized&gt;(u8, T)

the offset of the unsized field is

    0
    mem::align_of_val(&amp;self.1)

respectively. This patch changes the expression used to compute these
offsets so that the optimizer can perform this optimization.

Consider

```rust
fn f(x: &amp;X&lt;dyn Any&gt;) -&gt; &amp;dyn Any {
    &amp;x.0
}
```

Before:

```asm
test:
	movq	%rsi, %rdx
	movq	16(%rsi), %rax
	leaq	-1(%rax), %rcx
	negq	%rax
	andq	%rcx, %rax
	addq	%rdi, %rax
	retq
```

After:

```asm
test:
	movq	%rsi, %rdx
	movq	%rdi, %rax
	retq
```
</content>
</entry>
<entry>
<title>use PlaceRef more consistently instead of loosely coupled local+projection</title>
<updated>2021-01-03T13:14:55+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2021-01-02T18:31:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=afa74080410c1eba4cd23ddd8e2ac3d6ad1441e3'/>
<id>urn:sha1:afa74080410c1eba4cd23ddd8e2ac3d6ad1441e3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Optimize DST field access</title>
<updated>2020-12-19T19:43:15+00:00</updated>
<author>
<name>Julian Orth</name>
<email>ju.orth@gmail.com</email>
</author>
<published>2020-12-19T18:08:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=be1511408edbae0deb9b6aceed7cf22aa5ca8e76'/>
<id>urn:sha1:be1511408edbae0deb9b6aceed7cf22aa5ca8e76</id>
<content type='text'>
For

    struct X&lt;T: ?Sized&gt;(T)
    struct Y&lt;T: ?Sized&gt;(u8, T)

the offset of the unsized field is

    0
    mem::align_of_val(&amp;self.1)

respectively. This patch changes the expression used to compute these
offsets so that the optimizer can perform this optimization.

Consider

```rust
fn test(x: &amp;X&lt;dyn Any&gt;) -&gt; &amp;dyn Any {
    &amp;x.0
}
```

Before:

```asm
test:
	movq	%rsi, %rdx
	movq	16(%rsi), %rax
	leaq	-1(%rax), %rcx
	negq	%rax
	andq	%rcx, %rax
	addq	%rdi, %rax
	retq
```

After:

```asm
test:
	movq	%rsi, %rdx
	movq	%rdi, %rax
	retq
```
</content>
</entry>
<entry>
<title>compiler: fold by value</title>
<updated>2020-11-16T21:34:57+00:00</updated>
<author>
<name>Bastian Kauschke</name>
<email>bastian_kauschke@hotmail.de</email>
</author>
<published>2020-10-24T00:21:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2bf93bd852f0636eb4d052ee155bdb6cec592c53'/>
<id>urn:sha1:2bf93bd852f0636eb4d052ee155bdb6cec592c53</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace target.target with target and target.ptr_width with target.pointer_width</title>
<updated>2020-10-15T10:02:24+00:00</updated>
<author>
<name>est31</name>
<email>MTest31@outlook.com</email>
</author>
<published>2020-10-15T09:44:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4fa55787745ac71793253c47c4d6cd5ffe96b741'/>
<id>urn:sha1:4fa55787745ac71793253c47c4d6cd5ffe96b741</id>
<content type='text'>
Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.

On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.

Result of running:

find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt
</content>
</entry>
<entry>
<title>Auto merge of #73453 - erikdesjardins:tuplayout, r=eddyb</title>
<updated>2020-09-25T14:42:20+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-09-25T14:42:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5b9e8864032a3bfefa6f69c33fd99e0383a414af'/>
<id>urn:sha1:5b9e8864032a3bfefa6f69c33fd99e0383a414af</id>
<content type='text'>
Ignore ZST offsets when deciding whether to use Scalar/ScalarPair layout

This is important because Scalar/ScalarPair layout previously would not be used if any ZST had nonzero offset.
For example, before this change, only `((), u128)` would be laid out like `u128`, not `(u128, ())`.

Fixes #63244
</content>
</entry>
<entry>
<title>Change ty.kind to a method</title>
<updated>2020-09-04T15:47:51+00:00</updated>
<author>
<name>LeSeulArtichaut</name>
<email>leseulartichaut@gmail.com</email>
</author>
<published>2020-08-02T22:49:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3e14b684dd31794e8dbe6acd7a5f132997ee0c47'/>
<id>urn:sha1:3e14b684dd31794e8dbe6acd7a5f132997ee0c47</id>
<content type='text'>
</content>
</entry>
<entry>
<title>handle vector layout</title>
<updated>2020-08-30T18:58:03+00:00</updated>
<author>
<name>Erik Desjardins</name>
<email>erikdesjardins@users.noreply.github.com</email>
</author>
<published>2020-08-20T22:59:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=24e0913e37cc6fc363b37d13bf519db212f175a2'/>
<id>urn:sha1:24e0913e37cc6fc363b37d13bf519db212f175a2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ignore zst offsets instead</title>
<updated>2020-08-30T18:58:03+00:00</updated>
<author>
<name>Erik Desjardins</name>
<email>erikdesjardins@users.noreply.github.com</email>
</author>
<published>2020-08-16T23:25:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=68217c9e0f1269d29b4c1c72d08fb1b95bf441cd'/>
<id>urn:sha1:68217c9e0f1269d29b4c1c72d08fb1b95bf441cd</id>
<content type='text'>
</content>
</entry>
</feed>
