]> git.lizzy.rs Git - rust.git/commitdiff
Fix temporal_order argument order for store to load forwarding
authorbjorn3 <bjorn3@users.noreply.github.com>
Sat, 28 Dec 2019 15:11:04 +0000 (16:11 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Tue, 31 Dec 2019 14:56:28 +0000 (15:56 +0100)
src/optimize/stack2reg.rs

index 64f7ab04503685e49ea8591ab15ba8a94546ef95..8f27ad7c5571173546466140266f0fea70c37516 100644 (file)
@@ -116,9 +116,10 @@ pub(super) fn optimize_function(
                     temporal_order(&*ctx, store, load),
                 );
             }
+
             match *potential_stores {
                 [] => println!("[{}] [BUG?] Reading uninitialized memory", name),
-                [store] if spatial_overlap(&ctx.func, load, store) == SpatialOverlap::Full && temporal_order(&ctx, load, store) == TemporalOrder::DefinitivelyBefore => {
+                [store] if spatial_overlap(&ctx.func, store, load) == SpatialOverlap::Full && temporal_order(&ctx, store, load) == TemporalOrder::DefinitivelyBefore => {
                     let store_ebb = ctx.func.layout.inst_ebb(store).unwrap();
                     let stored_value = ctx.func.dfg.inst_args(store)[0];
                     let stored_type = ctx.func.dfg.value_type(stored_value);