[PATCH] D68924: CodeExtractor: NFC: Use Range based loop
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 13 10:28:47 PDT 2019
hiraditya added a comment.
Tried the following, I get test failures and crashes.
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 3e1bea77f6c..c4661fde0fb 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -929,8 +929,7 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
// Rewrite branches to basic blocks outside of the loop to new dummy blocks
// within the new function. This must be done before we lose track of which
// blocks were originally in the code region.
- std::vector<User *> Users(header->user_begin(), header->user_end());
- for (auto &U : Users)
+ for (auto U : header->users())
// The BasicBlock which contains the branch is not in the region
// modify the branch target to a new block
if (Instruction *I = dyn_cast<Instruction>(U))
Failing Tests (6):
LLVM :: Transforms/CodeExtractor/PartialInlineAndOr.ll
LLVM :: Transforms/CodeExtractor/PartialInlineOr.ll
LLVM :: Transforms/CodeExtractor/PartialInlineOrAnd.ll // Crashed: Assertion `(Flags & RF_IgnoreMissingLocals) && "Referenced value not in value map!"' failed.
LLVM :: Transforms/HotColdSplit/eh-pads.ll
LLVM :: Transforms/HotColdSplit/outline-multiple-entry-region.ll
LLVM :: Transforms/HotColdSplit/unwind.ll
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68924/new/
https://reviews.llvm.org/D68924
More information about the llvm-commits
mailing list