[llvm] [IPO] Remove a redundant cast (NFC) (PR #168297)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 16 15:08:46 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Idx is already of type unsigned.

Identified with readability-redundant-casting.


---
Full diff: https://github.com/llvm/llvm-project/pull/168297.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/IPO/IROutliner.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp
index e6ddc8029ce7b..6e1ca9c4cd2d6 100644
--- a/llvm/lib/Transforms/IPO/IROutliner.cpp
+++ b/llvm/lib/Transforms/IPO/IROutliner.cpp
@@ -2108,8 +2108,7 @@ static void createAndInsertBasicBlocks(DenseMap<Value *, BasicBlock *> &OldMap,
 
   for (Value *RetVal : SortedKeys) {
     BasicBlock *NewBB = BasicBlock::Create(
-        ParentFunc->getContext(),
-        Twine(BaseName) + Twine("_") + Twine(static_cast<unsigned>(Idx++)),
+        ParentFunc->getContext(), Twine(BaseName) + Twine("_") + Twine(Idx++),
         ParentFunc);
     NewMap.insert(std::make_pair(RetVal, NewBB));
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/168297


More information about the llvm-commits mailing list