[llvm] [VectorCombine] Add foldShuffleToIdentity (PR #88693)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 05:05:18 PDT 2024


================
@@ -1547,6 +1548,148 @@ bool VectorCombine::foldShuffleOfCastops(Instruction &I) {
   return true;
 }
 
+// Starting from a shuffle, look up through operands tracking the shuffled index
+// of each lane. If we can simplify away the shuffles to identities then
+// do so.
+bool VectorCombine::foldShuffleToIdentity(Instruction &I) {
+  FixedVectorType *Ty = dyn_cast<FixedVectorType>(I.getType());
----------------
alexey-bataev wrote:

```suggestion
  auto *Ty = dyn_cast<FixedVectorType>(I.getType());
```


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


More information about the llvm-commits mailing list