This patch contains minor changes I made to get examples/Kaleidoscope/MCJIT/initial/toy.cpp to compile, discussed in the following bug report:
http://llvm.org/bugs/show_bug.cgi?id=20329
Details
- Reviewers
rengolin andrew.w.kaylor lhames
Diff Detail
Event Timeline
examples/Kaleidoscope/MCJIT/initial/Makefile | ||
---|---|---|
3 | This should be ok, but again, people that have worked on the tutorial should have a better opinion. | |
examples/Kaleidoscope/MCJIT/initial/toy.cpp | ||
794 | It seems that all MCJIT Kaleidoscope files have this, as well as the documentation in docs/tutorial. If you're going to change, better change all. Also, from other patterns, the DataLayoutPass has the following usage: new DataLayoutPass(Module) which is not what you've used. I'm not sure how the pass manager is doing this at the moment, but other people may comment on that. Either way, better change all other files while you're at it. |
Added fixes for compiling all Kaleidoscope/MCJIT examples (patch made against r213970). Compiled these on x86-64 & ARMv7a and ran as described in the test plan. Summary of changes:
- Fixed compile flags to use llvm-config --cxxflags instead of llvm-config --cppflags
- Added -pthread -ldl -lcurses -lz linking flags (zlib is apparently a dependency of libLLVMSupport, should -lz be added to llvm-config?)
- API update: raw_fd_ostream constructor needs sys::fs::F_None as flags param (prev. value removed)
- API update: usage of MemoryBuffer::getFile changed
- API update: RTDyldMemoryManager::getPointerToNamedFunction deprecated; use getSymbolAddress
- API update: use DataLayoutPass(Module*) instead of DataLayout for FPM (now using the preferred signature which passes the module)
Additionally, the code that enabled object caching wasn't being triggered. I prefixed "IR:" to the module ID to cause the caching to happen. Additionally, -use-object-cache needs to be specified on the command line, which I added to the python scripts generating the timing in MCJIT/cached/genk-timing.py.
I can't comment on the other changes, which seem to be variations of the same fix on different files (and why do we have that many similar files bothers me), but I'll let someone that has actually changed Kaleidoscope recently to reply as to its validity.
My concerns were addressed. Thanks!
LGTM, but please get Andrew's, Lang's (or someone else closer to MCJIT) to approve.
cheers,
--renato
Hi,
Has this gone in? Is it still required/desired?
If yes, please ping the appropriate people, if not, please drop it.
Thanks,
--renato
Apologies for the very tardy review.
This all looks good to me, with one quibble: Where the link lines all include "-pthread -ldl -lcurses -lz", it would be preferable to add the --system-libs option to the llvm-config invocation instead. That should pull in those libraries.
If you have commit access, please go ahead and commit after making that change. If not, just ping me and I will commit it for you.
Thanks very much for your work on this Jesse.
This should be ok, but again, people that have worked on the tutorial should have a better opinion.