[llvm] [VectorCombine] foldSelectShuffle - remove extra adds of old shuffles to worklist (PR #127999)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Feb 20 04:24:42 PST 2025
    
    
  
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-vectorizers
Author: Simon Pilgrim (RKSimon)
<details>
<summary>Changes</summary>
We already push the old shuffles to the worklist as part of the replaceValue calls, so we shouldn't need to add them to the deferred list as well - my guess is this was to ensure that the instructions got erased first to help cleanup unused instructions, but eraseInstruction should handle this now.
---
Full diff: https://github.com/llvm/llvm-project/pull/127999.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/VectorCombine.cpp (-2) 
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 746742e14d080..cdb8853f7503c 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -3036,8 +3036,6 @@ bool VectorCombine::foldSelectShuffle(Instruction &I, bool FromReduction) {
   Worklist.pushValue(NSV0B);
   Worklist.pushValue(NSV1A);
   Worklist.pushValue(NSV1B);
-  for (auto *S : Shuffles)
-    Worklist.add(S);
   return true;
 }
 
``````````
</details>
https://github.com/llvm/llvm-project/pull/127999
    
    
More information about the llvm-commits
mailing list