From 5cd835b0d8d81b4b4fc0b7e01702066d9c2bca36 Mon Sep 17 00:00:00 2001 From: Troels Henriksen Date: Wed, 20 Mar 2024 15:02:03 +0100 Subject: [PATCH] Now works with Futhark HEAD. That these things need changing is arguably a Futhark defect, but it will be a little while before they can be fixed. --- src/compiler/codegen/register.fut | 4 ++-- src/compiler/passes/check_return_paths.fut | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/codegen/register.fut b/src/compiler/codegen/register.fut index db4fcdc..4b9ad58 100644 --- a/src/compiler/codegen/register.fut +++ b/src/compiler/codegen/register.fut @@ -84,13 +84,13 @@ let lifetime_analyze_valid [n] (instrs: [n]Instr) (symbol_registers: []SymbolDat let new_lifetime_mask = lifetime_mask & PRESERVED_REGISTER_MASK let spilled_register_mask = lifetime_mask & !PRESERVED_REGISTER_MASK - let spilled_registers = iota 64i64 |> map (\i -> + let spilled_registers = tabulate 64 (\i -> if spilled_register_mask & (1 << u64.i64 i) != 0 then i else -1 ) - let new_register_state = iota 64i64 |> map (\i -> + let new_register_state = tabulate 64 (\i -> if new_lifetime_mask & (1 << u64.i64 i) != 0 then register_state[i] else diff --git a/src/compiler/passes/check_return_paths.fut b/src/compiler/passes/check_return_paths.fut index b535dc4..a263763 100644 --- a/src/compiler/passes/check_return_paths.fut +++ b/src/compiler/passes/check_return_paths.fut @@ -15,7 +15,7 @@ local type bool_expr_node = (i32, i32, bool_expr_node_type) local let iter [n] (expr: [n]bool_expr_node): [n]bool_expr_node = let is_value_known ptr = expr[ptr].2 == #true || expr[ptr].2 == #false let value ptr = expr[ptr].2 == #true - let f (left, right, nty) = + let f (left, right, nty : bool_expr_node_type) = -- If this node already has a concrete value, then do nothing, as we are done with this node. if nty == #true || nty == #false then (left, right, nty) @@ -90,4 +90,4 @@ let check_return_paths [n] (node_types: [n]production.t) (parents: [n]i32) (prev -- holds whether the program is correct. |> (.[0]) |> (.2) - |> (== #true) + |> (== (#true : bool_expr_node_type))