[PATCH] D39760: [SimplifyCFG] Teach merge conditional stores to handle cases where the PostBB has more than 2 predecessors by inserting a new block for the store.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 13:59:16 PST 2017
efriedma added a comment.
Do you know how much impact this has, in the sense of making this transform trigger more often in benchmarks?
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2956
+ // sink the store.
+ if (std::next(pred_begin(PostBB), 2) != pred_end(PostBB)) {
+ BasicBlock *TruePred = QTB ? QTB : QFB->getSinglePredecessor();
----------------
You might want to explicitly note what is known about the terminators of QTB/QFB here; pred_begin can return a block multiple times in cases where a terminator contains multiple uses of a successor. (I don't think you can hit that case here, but it took me a few minutes to convince myself.)
https://reviews.llvm.org/D39760
More information about the llvm-commits
mailing list