{"comment":{"url":"https://api.github.com/repos/AnyDSL/thorin/comments/9923305","html_url":"https://github.com/AnyDSL/thorin/commit/770b71c2ec01731f04fba80cf056ce6825ae4b10#commitcomment-9923305","id":9923305,"user":{"login":"MasterCassim","id":1119511,"avatar_url":"https://avatars.githubusercontent.com/u/1119511?v=3","gravatar_id":"","url":"https://api.github.com/users/MasterCassim","html_url":"https://github.com/MasterCassim","followers_url":"https://api.github.com/users/MasterCassim/followers","following_url":"https://api.github.com/users/MasterCassim/following{/other_user}","gists_url":"https://api.github.com/users/MasterCassim/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterCassim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterCassim/subscriptions","organizations_url":"https://api.github.com/users/MasterCassim/orgs","repos_url":"https://api.github.com/users/MasterCassim/repos","events_url":"https://api.github.com/users/MasterCassim/events{/privacy}","received_events_url":"https://api.github.com/users/MasterCassim/received_events","type":"User","site_admin":false},"position":5,"line":35,"path":"src/thorin/analyses/bta.cpp","commit_id":"770b71c2ec01731f04fba80cf056ce6825ae4b10","created_at":"2015-02-25T21:00:43Z","updated_at":"2015-02-25T21:00:43Z","body":"You also need to set all parameters from extern functions and global variables to TOP; this already solves the problem with memory operations. Code from my implementation:\r\n\r\n    // all global variables are dynamic by default\r\n    for (auto primop : world.primops()) {\r\n        if (auto global = primop->isa<Global>())\r\n            global->join_lattice(LV_DYNAMIC);\r\n    }\r\n\r\n    // functions and arguments called from outside are dynamic\r\n    for(auto lambda : world.lambdas()) {\r\n        if(lambda->is_external() || lambda->cc() == CC::Device) {\r\n            //lambda->join_lattice(DYNAMIC);\r\n\r\n            for(auto param : lambda->params()) {\r\n                param->join_lattice(LV_DYNAMIC);\r\n            }\r\n        }\r\n    }\r\n"}}