-
Notifications
You must be signed in to change notification settings - Fork 130
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
What command does write_bitcode execute? #821
Comments
I debuged it. #0 compiler_gym::llvm_service::makeModule (context=..., bitcode=...,
name="benchmark://file-v0/home/relay/workspace/ppo/ppo_compiler_gym_clang10/bzip2/build_ppo_to_obj/bzip2.c.ori.bc",
status=0x7f888f49df48) at compiler_gym/envs/llvm/service/Benchmark.cc:109
#1 0x0000000000e0c2bc in compiler_gym::llvm_service::(anonymous namespace)::makeModuleOrDie (context=..., bitcode=...,
name="benchmark://file-v0/home/relay/workspace/ppo/ppo_compiler_gym_clang10/bzip2/build_ppo_to_obj/bzip2.c.ori.bc")
at compiler_gym/envs/llvm/service/Benchmark.cc:51
#2 0x0000000000e0c0fd in compiler_gym::llvm_service::Benchmark::Benchmark (this=0x7f8888227cc0,
name="benchmark://file-v0/home/relay/workspace/ppo/ppo_compiler_gym_clang10/bzip2/build_ppo_to_obj/bzip2.c.ori.bc", bitcode=...,
dynamicConfig=..., workingDirectory=..., baselineCosts=...)
at compiler_gym/envs/llvm/service/Benchmark.cc:147
#3 0x0000000000e105fc in std::make_unique<compiler_gym::llvm_service::Benchmark, std::string const&, llvm::SmallString<0u>&, compiler_gym::BenchmarkDynamicConfig const&, boost::filesystem::path const&, std::array<double, 9ul> const&> (__args=..., __args=..., __args=..., __args=..., __args=...)
at /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/unique_ptr.h:831
#4 0x0000000000e0cc60 in compiler_gym::llvm_service::Benchmark::clone (this=0x7f8888217a20, workingDirectory=...)
at compiler_gym/envs/llvm/service/Benchmark.cc:185
#5 0x0000000000db0845 in compiler_gym::llvm_service::BenchmarkFactory::getBenchmark (
this=0x318e040 <compiler_gym::llvm_service::BenchmarkFactory::getSingleton(boost::filesystem::path const&, std::optional<std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul> >, unsigned long)::instance>, benchmarkMessage=..., benchmark=0x7f888f49f2b8)
at compiler_gym/envs/llvm/service/BenchmarkFactory.cc:60
#6 0x0000000000db133d in compiler_gym::llvm_service::BenchmarkFactory::getBenchmark (
this=0x318e040 <compiler_gym::llvm_service::BenchmarkFactory::getSingleton(boost::filesystem::path const&, std::optional<std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul> >, unsigned long)::instance>, benchmarkMessage=..., benchmark=0x7f888f49f2b8)
at compiler_gym/envs/llvm/service/BenchmarkFactory.cc:94
#7 0x0000000000d6e2d0 in compiler_gym::llvm_service::LlvmSession::init (this=0x7f8888006d90, actionSpace=..., benchmark=...)
at compiler_gym/envs/llvm/service/LlvmSession.cc:90
#8 0x0000000000d3e31c in compiler_gym::runtime::CompilerGymService<compiler_gym::llvm_service::LlvmSession>::StartSession (this=0x7ffc64ed7218,
context=0x7f8888001800, request=0x7f888800ad30, reply=0x7f888f4a01b0)
at compiler_gym/service/runtime/CompilerGymServiceImpl.h:82
#9 0x00000000025ba26c in compiler_gym::CompilerGymService::Service::Service()::$_2::operator()(compiler_gym::CompilerGymService::Service*, grpc::ServerContext*, compiler_gym::StartSessionRequest const*, compiler_gym::StartSessionReply*) const (this=0x3736928, service=0x7ffc64ed7218,
ctx=0x7f8888001800, req=0x7f888800ad30, resp=0x7f888f4a01b0)
|
Hi @zcfh, that's a good question! Tbh it's a long time since I worked on this bit of the codebase and I can't remember. Perhaps it's to decouple the cloned version from the LLVM context? |
❓ Questions and Help
For env that has not executed any action, call write_bitcode directly. The generated bitcode is different from the original bitcode. I want to know what happened during this period? Was opt executed again?
I set
COMPILER_GYM_DEBUG=99
. According to the log, it seems that the first timellvm::parseBitcodeFile(83068 bits)
loaded the original bitcode, and thenllvm::parseBitcodeFile(77648)
was executed again without performing any operations. bitcode, here is the last written bitcode, but I haven’t found where it is called.Additional Context
The text was updated successfully, but these errors were encountered: