[PATCH] D154996: [ConstantHoisting] use BasicBlock::getFirstInsertionPt
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 11:47:29 PDT 2023
nickdesaulniers created this revision.
Herald added a subscriber: hiraditya.
Herald added a reviewer: ributzka.
Herald added a project: All.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Rather than open coding the same implementation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D154996
Files:
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
Index: llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -323,12 +323,8 @@
if (BFI) {
findBestInsertionSet(*DT, *BFI, Entry, BBs);
- for (auto *BB : BBs) {
- BasicBlock::iterator InsertPt = BB->begin();
- for (; isa<PHINode>(InsertPt) || InsertPt->isEHPad(); ++InsertPt)
- ;
- InsertPts.insert(&*InsertPt);
- }
+ for (BasicBlock *BB : BBs)
+ InsertPts.insert(&*BB->getFirstInsertionPt());
return InsertPts;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154996.539220.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230711/cdbc6cd8/attachment.bin>
More information about the llvm-commits
mailing list