diff options
| author | bors <bors@rust-lang.org> | 2024-07-29 12:36:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-29 12:36:57 +0000 |
| commit | 4db3d12e6f395babed53dee1d209a5c8699a5ae6 (patch) | |
| tree | 85c21519831e49931e4fecf51e69614a7d66257c /compiler/rustc_lint/src | |
| parent | 56c698c71130de6fe55ba703a161405b6145b90e (diff) | |
| parent | ae681c940dd0813f75770fecd4f565d376b37d37 (diff) | |
| download | rust-4db3d12e6f395babed53dee1d209a5c8699a5ae6.tar.gz rust-4db3d12e6f395babed53dee1d209a5c8699a5ae6.zip | |
Auto merge of #128265 - DianQK:instsimplify-before-inline, r=saethlin
Perform instsimplify before inline to eliminate some trivial calls
I am currently working on #128081. In the current pipeline, we can get the following clone statements ([godbolt](https://rust.godbolt.org/z/931316fhP)):
```
bb0: {
StorageLive(_2);
_2 = ((*_1).0: i32);
StorageLive(_3);
_3 = ((*_1).1: u64);
_0 = Foo { a: move _2, b: move _3 };
StorageDead(_3);
StorageDead(_2);
return;
}
```
Analyzing such statements will be simple and fast. We don't need to consider branches or some interfering statements. However, this requires us to run `InstSimplify`, `ReferencePropagation`, and `SimplifyCFG` at least once. I can introduce a new pass, but I think the best place for it would be within `InstSimplify`.
I put `InstSimplify` before `Inline`, which takes some of the burden away from `Inline`.
r? `@saethlin`
Diffstat (limited to 'compiler/rustc_lint/src')
0 files changed, 0 insertions, 0 deletions
