[llvm] ea825f2 - [Cloning] Pass blocks as ArrayRef to remapInstructions (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 12:03:43 PST 2023
Author: Florian Hahn
Date: 2023-02-03T20:03:16Z
New Revision: ea825f27a168a5c18b8564e2205d5293cada5a11
URL: https://github.com/llvm/llvm-project/commit/ea825f27a168a5c18b8564e2205d5293cada5a11
DIFF: https://github.com/llvm/llvm-project/commit/ea825f27a168a5c18b8564e2205d5293cada5a11.diff
LOG: [Cloning] Pass blocks as ArrayRef to remapInstructions (NFC).
Passing ArrayRef doesn't force users to construct a SmallVector to pass
blocks.
Added:
Modified:
llvm/include/llvm/Transforms/Utils/Cloning.h
llvm/lib/Transforms/Utils/CloneFunction.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h
index 77050391746bc..85343a6f66b2d 100644
--- a/llvm/include/llvm/Transforms/Utils/Cloning.h
+++ b/llvm/include/llvm/Transforms/Utils/Cloning.h
@@ -286,7 +286,7 @@ Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
SmallVectorImpl<BasicBlock *> &Blocks);
/// Remaps instructions in \p Blocks using the mapping in \p VMap.
-void remapInstructionsInBlocks(const SmallVectorImpl<BasicBlock *> &Blocks,
+void remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
ValueToValueMapTy &VMap);
/// Split edge between BB and PredBB and duplicate all non-Phi instructions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 87822ee85c2bd..315263a05105d 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -937,8 +937,8 @@ void llvm::CloneAndPruneFunctionInto(
}
/// Remaps instructions in \p Blocks using the mapping in \p VMap.
-void llvm::remapInstructionsInBlocks(
- const SmallVectorImpl<BasicBlock *> &Blocks, ValueToValueMapTy &VMap) {
+void llvm::remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
+ ValueToValueMapTy &VMap) {
// Rewrite the code to refer to itself.
for (auto *BB : Blocks)
for (auto &Inst : *BB)
More information about the llvm-commits
mailing list