ispras/llv8

llvm::Value*s might get corrupted by LLVM optimization passes

vivanishin opened this issue · 0 comments

Possible bug: llvm::Value* may not be there after optimization passes. But LLVMEnvironment stores a list of llvm::Value*s. One solution is to give all of them unique names, store and lookup by the name or introduce phony usages (and name them and delete later after optimization is done). The problem is similar to that with LLVMChunkBuilder::pointers_, only now we care about more that 2 transformation passes.

Other people must have faced and solved this problem before.

Again, may be it's not even a bug (haven't had issues with this yet). See what LLVM documentation has to say. Although clearly a value can get DCEd, in which case it's totally not a good thing to reference it.