[llvm] LoopRotationUtils: Use initializer list instead of repeated push_back (PR #139312)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 12:03:05 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/139312

None

>From 3acc37aaa910974b4b1c22b6997d03a120b5026d Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Fri, 9 May 2025 20:52:57 +0200
Subject: [PATCH] LoopRotationUtils: Use initializer list instead of repeated
 push_back

---
 llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index 73d074029d810..693b1f517f8d0 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -822,10 +822,10 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
     if (DT) {
       // The OrigPreheader branches to the NewHeader and Exit now. Then, inform
       // the DT about the removed edge to the OrigHeader (that got removed).
-      SmallVector<DominatorTree::UpdateType, 3> Updates;
-      Updates.push_back({DominatorTree::Insert, OrigPreheader, Exit});
-      Updates.push_back({DominatorTree::Insert, OrigPreheader, NewHeader});
-      Updates.push_back({DominatorTree::Delete, OrigPreheader, OrigHeader});
+      SmallVector<DominatorTree::UpdateType, 3> Updates = {
+          {DominatorTree::Insert, OrigPreheader, Exit},
+          {DominatorTree::Insert, OrigPreheader, NewHeader},
+          {DominatorTree::Delete, OrigPreheader, OrigHeader}};
 
       if (MSSAU) {
         MSSAU->applyUpdates(Updates, *DT, /*UpdateDT=*/true);



More information about the llvm-commits mailing list