simit-lang / simit

A language for computing on sparse systems
http://simit-lang.org
Other
452 stars 52 forks source link

Simit program compiled with timers fails at runtime #80

Closed ChrisAndre closed 7 years ago

ChrisAndre commented 7 years ago

Hi all,

A few weeks ago I attempted to enable runtime profiling in the Simit test suite, but ran into an issue that I wasn't able to resolve immediately.

I enabled the PROFILE flag (at simit-test.cpp:32) and attempted to run it. There is a related pre-bug that I found in doing so (not related to the timer problem). In printTimedCallGraph (lower.cpp:79), the ostream parameter that it takes is always nullptr because of upstream logic, but it is printed to anyways. It looked like it was forgotten in a refactor of a similar function (likely the normal compile without timers endpoint right next to it) to change the printing logic, but I do not have my notes for that on hand. I was able to clear that bug up quickly, but do not have my proposed fix on hand right now.

I then ran into the following error when running the test suite: "Program used external function 'storeTime' which could not be resolved". My research showed me that this traces back to LLVM, and was likely a linking error, but I was unable to determine why that symbol wasn't being loaded properly into the LLVM runtime along with the other intrinsics. My initial attempt to step around the issue by feeding LLVM the 'storeTime' method by hand didn't resolve the issue, so I left it for another day.

I'm hoping you have better insight into this than I do, as I am not very familiar with LLVM yet.

Cheers!

stephenchouca commented 7 years ago

Hi Chris,

Thanks for bringing this issue to our attention! The link-time error was actually also the result of incomplete refactoring that was done some time ago. I've implemented a fix that should resolve this problem (plus some other timer-related issues).