This patch factors out code to clone a basic block -- partly for
readability and partly to facilitate an upcoming patch of my own.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Scalar/JumpThreading.cpp | ||
---|---|---|
1976–1978 | It is a little weird for the interface to leave the insertion of BB terminator outside. Can we add SuccBB as another param, and include some processing after the call of CloneBasicBlock into this function? | |
1991–1996 | The Block frequency update seems not precise enough. I feel it is more precise to use BB-->SuccBB branch probablity to compute the block frequency of NewBB. That can be a separated change from this refactoring, but it suggests we may want to include SuccBB as a param. |
I've decided to scale back. I'm now simply factoring out code to
clone instructions. I thought about capturing more functionality into
CloneBasicBlock as you suggeted, but then the function would lose
generality I need for my upcoming patch.
It is a little weird for the interface to leave the insertion of BB terminator outside. Can we add SuccBB as another param, and include some processing after the call of CloneBasicBlock into this function?