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

Compilation error in Calculate Bounds Compiler pass. #189

Open
vidsinghal opened this issue Jan 26, 2023 · 0 comments
Open

Compilation error in Calculate Bounds Compiler pass. #189

vidsinghal opened this issue Jan 26, 2023 · 0 comments

Comments

@vidsinghal
Copy link
Collaborator

module Main where

import Strings
import Contents
import Adts
import Tags

-- Trigger the bug in the calculate bounds pass. 
-- Error message: 
-- recovertype/primapp: MkTrue []
-- recovertype/primapp: MkFalse []
-- gibbon: Map lookup failed on key: Var "cpy_3273" in map:
-- []
-- CallStack (from HasCallStack):
--  error, called at src/Gibbon/Common.hs:289:7 in gibbon-0.2-inplace:Gibbon.Common
--  err, called at src/Gibbon/Common.hs:302:22 in gibbon-0.2-inplace:Gibbon.Common
--  #, called at src/Gibbon/Passes/CalculateBounds.hs:174:110 in gibbon-0.2-inplace:Gibbon.Passes.CalculateBounds
--  current work around is commenting out the this line  else go "inferRegSize" inferRegSize l2 in Compiler.hs pass and replacing it with pure l2
--  compiled via: gibbon --packed --no-gc --to-exe replicate_calculateBounds_bug.hs

searchTagAdt :: Adt -> Tags -> Adt
searchTagAdt inList tag = case inList of
				Nil -> Nil
                                TCA tags content rst -> let present = searchTag tag tags
                                                            newRst  = searchTagAdt rst tag
                                                        in if (present) then TCA tags content newRst else newRst
                                TAC tags rst content -> let present = searchTag tag tags
                                                            newRst  = searchTagAdt rst tag
                                                        in if (present) then TAC tags newRst content else newRst
                                ACT rst content tags -> let present = searchTag tag tags
				                 	    newRst  = searchTagAdt rst tag
                                                        in if (present) then ACT newRst content tags else newRst
                                ATC rst tags content -> let present = searchTag tag tags
                                                            newRst  = searchTagAdt rst tag
                                                        in if (present) then ATC newRst tags content else newRst


-- mk for 3 parameter Adt take, len, tagLen, strLen
gibbon_main =
    let act = mkACTList 100000 50 1000 
        tag = Tag 1000000 Nul        
        add_act    = iterate (searchTagAdt act tag)
    in ()

Code and module files available here: https://github.com/iu-parfunc/gibbon/tree/master/gibbon-compiler/examples/layout_benchmarks

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

No branches or pull requests

1 participant