[llvm] 6b2fd90 - [Hexagon] Construct SmallVector with an iterator range (NFC) (#136416)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 19 09:10:11 PDT 2025
Author: Kazu Hirata
Date: 2025-04-19T09:10:08-07:00
New Revision: 6b2fd90bb8e9567e5f200ae343d6d0eaedc03782
URL: https://github.com/llvm/llvm-project/commit/6b2fd90bb8e9567e5f200ae343d6d0eaedc03782
DIFF: https://github.com/llvm/llvm-project/commit/6b2fd90bb8e9567e5f200ae343d6d0eaedc03782.diff
LOG: [Hexagon] Construct SmallVector with an iterator range (NFC) (#136416)
This patch switches to SmallVector so that we can construct an
instance with an iterator range.
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
index 79169a0c20e58..9604f252dd3df 100644
--- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
@@ -1079,9 +1079,7 @@ bool PolynomialMultiplyRecognize::promoteTypes(BasicBlock *LoopB,
return false;
// Perform the promotion.
- std::vector<Instruction*> LoopIns;
- std::transform(LoopB->begin(), LoopB->end(), std::back_inserter(LoopIns),
- [](Instruction &In) { return &In; });
+ SmallVector<Instruction *> LoopIns(llvm::make_pointer_range(*LoopB));
for (Instruction *In : LoopIns)
if (!In->isTerminator())
promoteTo(In, DestTy, LoopB);
More information about the llvm-commits
mailing list