Fix potential_stores_for_load

This commit is contained in:
bjorn3 2019-12-30 21:20:17 +01:00
parent d6c2db2aea
commit fd5efa0921

View File

@ -34,12 +34,12 @@ struct StackSlotUsage {
impl StackSlotUsage {
fn potential_stores_for_load(&self, ctx: &Context, load: Inst) -> Vec<Inst> {
self.stack_store.iter().cloned().filter(|&store| {
match spatial_overlap(&ctx.func, load, store) {
match spatial_overlap(&ctx.func, store, load) {
SpatialOverlap::No => false, // Can never be the source of the loaded value.
SpatialOverlap::Partial | SpatialOverlap::Full => true,
}
}).filter(|&store| {
match temporal_order(ctx, load, store) {
match temporal_order(ctx, store, load) {
TemporalOrder::NeverBefore => false, // Can never be the source of the loaded value.
TemporalOrder::MaybeBefore | TemporalOrder::DefinitivelyBefore => true,
}