[PATCH] D25477: [JumpThreading] Unfold selects that depend on the same condition
Haicheng Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 19 12:34:50 PDT 2016
haicheng added a comment.
The code looks good except the formatting issues.
================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:1943-1953
BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "select.unfold",
BB->getParent(), BB);
// Move the unconditional branch to NewBB.
PredTerm->removeFromParent();
NewBB->getInstList().insert(NewBB->end(), PredTerm);
// Create a conditional branch and update PHI nodes.
BranchInst::Create(NewBB, BB, SI->getCondition(), Pred);
----------------
Since you refactor the code of expanding select, maybe you want to refactor the code here, too.
https://reviews.llvm.org/D25477
More information about the llvm-commits
mailing list