[PATCH] D50591: [PGO] Control Height Reduction

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 16:05:10 PDT 2018


yamauchi added inline comments.


================
Comment at: lib/Transforms/Instrumentation/ControlHeightReduction.cpp:1727
+  OldBR->dropAllReferences();
+  BranchInst *NewBR = BranchInst::Create(NewEntryBlock,
+                                         cast<BasicBlock>(VMap[NewEntryBlock]),
----------------
davidxl wrote:
> Is is possible for this be 'folded' into unconditional branch given the true predicate?
The true predicate is a placeholder. It will be replaced later in fixupBranchesAndSelects(). Added a comment.


================
Comment at: lib/Transforms/Instrumentation/ControlHeightReduction.cpp:1730
+                                         ConstantInt::getTrue(F.getContext()));
+  PreEntryBlock->getInstList().push_back(NewBR);
+  assert(NewEntryBlock->getSinglePredecessor() == EntryBlock &&
----------------
davidxl wrote:
> Is it better to use IRBuilder interface here?
I'll keep it here as is to be symmetric with the removal of the old branch instruction above. But I'll use IRBuilder in the other places (addToMergedCondition()).


Repository:
  rL LLVM

https://reviews.llvm.org/D50591





More information about the llvm-commits mailing list