diff options
| author | bors <bors@rust-lang.org> | 2023-10-08 12:38:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-08 12:38:14 +0000 |
| commit | 4f4a413fe6931d0ad9d3ac6bd20ff36398961e64 (patch) | |
| tree | ec69e5d1582f1cc6931a0f2e672e9593cc1478c7 /compiler/rustc_codegen_ssa | |
| parent | 1e3c8f196b2753b3e463bc6be2dc446f36653279 (diff) | |
| parent | eaafb256f8e729338603476ab1e54b804efead91 (diff) | |
| download | rust-4f4a413fe6931d0ad9d3ac6bd20ff36398961e64.tar.gz rust-4f4a413fe6931d0ad9d3ac6bd20ff36398961e64.zip | |
Auto merge of #116454 - tmiasko:small-dominators, r=cjgillot
Generalize small dominators optimization * Use small dominators optimization from 640ede7b0a1840415cb6ec881c2210302bfeba18 more generally. * Merge `DefLocation` and `LocationExtended` since they serve the same purpose.
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/analyze.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs index 7fda2d5fadf..62e997e5cfa 100644 --- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs +++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs @@ -8,7 +8,7 @@ use rustc_index::bit_set::BitSet; use rustc_index::{IndexSlice, IndexVec}; use rustc_middle::mir::traversal; use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor}; -use rustc_middle::mir::{self, Location, TerminatorKind}; +use rustc_middle::mir::{self, DefLocation, Location, TerminatorKind}; use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( @@ -67,21 +67,6 @@ enum LocalKind { SSA(DefLocation), } -#[derive(Copy, Clone, PartialEq, Eq)] -enum DefLocation { - Argument, - Body(Location), -} - -impl DefLocation { - fn dominates(self, location: Location, dominators: &Dominators<mir::BasicBlock>) -> bool { - match self { - DefLocation::Argument => true, - DefLocation::Body(def) => def.successor_within_block().dominates(location, dominators), - } - } -} - struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> { fx: &'mir FunctionCx<'a, 'tcx, Bx>, dominators: &'mir Dominators<mir::BasicBlock>, |
