kavon/ghc-llvm

Surgery Location

Closed this issue · 0 comments

kavon commented

It looks like the stack protector implementation does something similar to what we want to do, which involves splitting apart blocks during LLVM IR -> SelectionDAG IR translation. To quote:

"While one can not handle multiple IR level basic blocks at the SelectionDAG Level, one can generate multiple machine basic blocks for one IR level basic block [in SelectionDAGBuilder]. This is how we handle bit tests and switches."

They have a very detailed comment describing the steps and process to do the block splitting.