I am trying to find an example code which uses llvm::CloneBasicBlock, but can’t find it. I am having problems with PHI nodes and problem with instruction domination. So I’ll appreciate any good example code which teach how to use llvm::CloneBasicBlock properly.
I am trying to find an example code which uses llvm::CloneBasicBlock , but can’t
Share
What’s wrong with looking in the LLVM source itself?
CloneBasicBlockis used in a number of places. The simplest is probablyllvm::CloneFunctionInto; it should probably be enough to demonstrate how to correctly use the function (in terms of what arguments to pass, etc.)A more interesting example is in
llvm::LoopUnroll, which also has to deal with references from PHI nodes.