Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soa: Modify Infer Locations #274

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Soa: Modify Infer Locations #274

wants to merge 10 commits into from

Conversation

vidsinghal
Copy link
Collaborator

@vidsinghal vidsinghal commented Dec 2, 2024

1: For this PR i want to focus on infer locations. I want to generate a meaningful IR that changes the locations to SoA Locations. with functions being able to access those locations correctly in the code.

For this project, I think it makes sense to make PRs "per pass".

AoS list representation of add1 right after inferlocations

{meta: FunMeta {funRec = Rec, funInline = NoInline, funCanTriggerGC = False}}
add1 :: List -> List
        {locvars [LRM {lrmLoc = Single "loc_154",
                       lrmReg = AoSR (VarR "r_156"),
                       lrmMode = Input},
                  LRM {lrmLoc = Single "loc_155",
                       lrmReg = AoSR (VarR "r_157"),
                       lrmMode = Output}],
         effs:  [],
         locrets:  [],
         parallel:  False}
add1 lst_17_96_134 =
    letloc (Single "loc_218") = ((Single "loc_155") + 1) in
    letloc (Single "loc_219") = ((Single "loc_218") + 8) in
    case lst_17_96_134 of
        Nil ->
            (Nil (Single "loc_155"))
        Cons i_18_97_135::(Single "case_213") rst_19_98_136::(Single "case_214") ->
            let i1_20_99_137 :: Int = i_18_97_135 + 1 in
            let fltPkd_102_138 :: (Packed List (Single "loc_219")) = (add1 [(Single "case_214"),(Single "loc_219")] rst_19_98_136) in
            (Cons (Single "loc_155") i1_20_99_137 fltPkd_102_138)

What SoA list representation of add1 could look like right after inferlocations

{meta: FunMeta {funRec = Rec, funInline = NoInline, funCanTriggerGC = False}}
add1 :: List -> List
        {locvars [LRM {lrmLoc = SoA "loc_154" [(("Cons", 0), "loc_156")],
                       lrmReg = SoAR (VarR "r_156") [(("Cons", 0)), (VarR "r_158")],
                       lrmMode = Input},
                  LRM {lrmLoc = SoA "loc_155" [(("Cons", 0), "loc_157")] ,
                       lrmReg = SoAR (VarR "r_157") [(("Cons", 0), (VarR "r_159"))],
                       lrmMode = Output}],
         effs:  [],
         locrets:  [],
         parallel:  False}
add1 lst_17_96_134 =
    letloc (SoA "loc_218" [(("Cons", 0), "loc_219")]) = (SoA ("loc_155" + 1) [(("Cons", 0), ("loc_157" + 8))]) in
    case lst_17_96_134 of
        Nil ->
            (Nil (SoA "loc_155" [(("Cons", 0), "loc_157")]))
        Cons i_18_97_135::(Single "case_213") rst_19_98_136::(Single "case_214") ->
            let i1_20_99_137 :: Int = i_18_97_135 + 1 in
            let fltPkd_102_138 :: (Packed List (SoA "loc_218" [(("Cons", 0), "loc_219")])) = (add1 [(Single "case_213"), (Single "case_214"),(SoA "loc_218" [(("Cons", 0), "loc_219")])] rst_19_98_136) in
            (Cons (SoA "loc_155" [(("Cons", 0), "loc_157")]) i1_20_99_137 fltPkd_102_138)

@vidsinghal vidsinghal changed the title Soa Soa: Modify Infer Locations Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant