When moving an entire basic block BB before InsertPoint, currently we check for all instructions whether the operands dominates InsertPoint, however, this can be improved such that even an operand does not dominate InsertPoint, as long as it appears as a previous instruction in the same BB, it is safe to move.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/CodeMoverUtils.cpp | ||
---|---|---|
348 | Do you think this is more clear? |
llvm/lib/Transforms/Utils/CodeMoverUtils.cpp | ||
---|---|---|
348 | Thanks for the suggestion! It's definitely more clear. I updated the patch accordingly. |
Do you think this is more clear?
if (CheckForEntireBlock && I.getParent() == OpInst->getParent() && DT.dominates(OpInst, &I))