@@ -1348,20 +1348,25 @@ cursorizePackedExp freeVarToVarEnv lenv ddfs fundefs denv tenv senv ex =
13481348 let_assign_write_cur <$> LetE (d',[] , CursorTy , Ext $ WriteVector write_vector_at rnd' (stripTyLocs el_ty)) <$>
13491349 go2 marker_added fvarenv' aft_dloc from_rec_end aft_flocs' rst
13501350
1351- _ -> error $ " TODO: Cursorize: cursorizePackedExp: Ty not implemented!! " ++ show (ty)
1351+ -- _ -> error $ "TODO: Cursorize: cursorizePackedExp: Ty not implemented!! " ++ show (ty)
13521352
13531353 -- -- Write a pointer to a vector
13541354 -- ListTy el_ty -> do
13551355 -- rnd' <- cursorizeExp freeVarToVarEnv ddfs fundefs denv tenv senv rnd
13561356 -- LetE (d',[], CursorTy, Ext $ WriteList d rnd' (stripTyLocs el_ty)) <$>
13571357 -- go2 marker_added d' rst
13581358
1359- -- -- shortcut pointer
1360- -- CursorTy -> do
1361- -- rnd' <- cursorizeExp freeVarToVarEnv ddfs fundefs denv tenv senv rnd
1362- -- LetE (d',[], CursorTy, Ext $ WriteTaggedCursor d rnd') <$>
1363- -- go2 marker_added d' rst
1364- -- _ -> error $ "Unknown type encounterred while cursorizing DataConE. Type was " ++ show ty
1359+ -- shortcut pointer
1360+ -- SoA case
1361+ -- Fix case for indirection/shortcut pointers
1362+ CursorTy -> do
1363+ rnd' <- cursorizeExp freeVarToVarEnv lenv ddfs fundefs denv tenv senv rnd
1364+ after_indirection <- gensym " aft_indirection"
1365+ LetE (d',[] , CursorTy , Ext $ WriteTaggedCursor aft_dloc rnd') <$>
1366+ LetE (after_indirection,[] , CursorTy , VarE d') <$> -- Ext $ AddCursor aft_dloc (L3.LitE 8)
1367+ go2 marker_added freeVarToVarEnv after_indirection from_rec_end aft_flocs rst
1368+
1369+ _ -> error $ " Unknown type encounterred while cursorizing DataConE. Type was " ++ show ty
13651370
13661371
13671372
@@ -1576,7 +1581,11 @@ cursorizePackedExp freeVarToVarEnv lenv ddfs fundefs denv tenv senv ex =
15761581 if gopt Opt_DisableGC dflags
15771582 -- | | (from_reg == "dummy" || to_reg == "dummy") -- HACK!!!
15781583 -- [2022.03.02]: ckoparkar:WTH does this hack enable?
1579- then go freeVarToVarEnv tenv senv (DataConE from dcon [VarE (((unwrapLocVar . toLocVar)) to)])
1584+ then do
1585+ let locs_var = case M. lookup (fromLocArgToFreeVarsTy to) freeVarToVarEnv of
1586+ Nothing -> error " Did not find variable for location!"
1587+ Just var -> var
1588+ go freeVarToVarEnv tenv senv (DataConE from dcon [VarE locs_var])
15801589 else do
15811590 start <- gensym " start"
15821591 end <- gensym " end"
0 commit comments