{"action":"opened","issue":{"url":"https://api.github.com/repos/GJDuck/LowFat/issues/13","repository_url":"https://api.github.com/repos/GJDuck/LowFat","labels_url":"https://api.github.com/repos/GJDuck/LowFat/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/GJDuck/LowFat/issues/13/comments","events_url":"https://api.github.com/repos/GJDuck/LowFat/issues/13/events","html_url":"https://github.com/GJDuck/LowFat/issues/13","id":352503008,"node_id":"MDU6SXNzdWUzNTI1MDMwMDg=","number":13,"title":"Improving lowfat_stack_mirror","user":{"login":"janhoogerbrugge","id":5245140,"node_id":"MDQ6VXNlcjUyNDUxNDA=","avatar_url":"https://avatars2.githubusercontent.com/u/5245140?v=4","gravatar_id":"","url":"https://api.github.com/users/janhoogerbrugge","html_url":"https://github.com/janhoogerbrugge","followers_url":"https://api.github.com/users/janhoogerbrugge/followers","following_url":"https://api.github.com/users/janhoogerbrugge/following{/other_user}","gists_url":"https://api.github.com/users/janhoogerbrugge/gists{/gist_id}","starred_url":"https://api.github.com/users/janhoogerbrugge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janhoogerbrugge/subscriptions","organizations_url":"https://api.github.com/users/janhoogerbrugge/orgs","repos_url":"https://api.github.com/users/janhoogerbrugge/repos","events_url":"https://api.github.com/users/janhoogerbrugge/events{/privacy}","received_events_url":"https://api.github.com/users/janhoogerbrugge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-21T11:46:16Z","updated_at":"2018-08-21T11:46:16Z","closed_at":null,"author_association":"NONE","body":"This is the original code to implement lowfat_stack_mirror:\r\n\r\n        Value *Offsets = M->getOrInsertGlobal(\"lowfat_stack_offsets\",\r\n            ArrayType::get(builder.getInt64Ty(), 0));\r\n        if (GlobalVariable *Global = dyn_cast<GlobalVariable>(Offsets))\r\n            Global->setConstant(true);\r\n\r\nReplacing this by:\r\n\r\n        int size = sizeof(lowfat_stack_offsets) / sizeof(lowfat_stack_offsets[0]);\r\n        ArrayType *type = ArrayType::get(builder.getInt64Ty(), size);\r\n        Value *Offsets = M->getOrInsertGlobal(\"lowfat_stack_offsets\", type);\r\n        if (GlobalVariable *Global = dyn_cast<GlobalVariable>(Offsets))\r\n        {\r\n            vector<Constant *> values(size);\r\n            for (int i = 0; i < size; i++)\r\n                values[i] = builder.getInt64(lowfat_stack_offsets[i]);\r\n            Global->setConstant(true);\r\n            Global->setInitializer(ConstantArray::get(type, values));\r\n            Global->setLinkage(GlobalValue::InternalLinkage);\r\n        }\r\n\r\nmakes that a successive optimization pass replaces the table lookup by the proper \r\nentry from lowfat_stack_offsets if the index is constant (which is most of the time).\r\n\r\nIt works. However running 433.milc with protecting only the writes makes that the \r\nbenchmarks crashes (at run-time). All other benchmarks of SPEC2006 run fine.\r\nI narrowed it down to the pp array in make_loop_table and add_basic_path. Any \r\nidea what might be wrong. The optimization seems so trivial.\r\n\r\nDoing the replacement of a table lookup by the entry in the lowfat pass itself instead\r\nof a later pass is not working as well. It fails in the same way."}}
{"actor":{"display_login":"janhoogerbrugge"}}