[llvm] [llvm][SLPVectorizer] Fix a bad cast assertion (PR #97621)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 16:17:52 PDT 2024


================
@@ -361,12 +361,14 @@ static bool isCommutative(Instruction *I) {
   return I->isCommutative();
 }
 
-/// \returns inserting index of InsertElement or InsertValue instruction,
-/// using Offset as base offset for index.
-static std::optional<unsigned> getInsertIndex(const Value *InsertInst,
-                                              unsigned Offset = 0) {
+template <typename T>
+static std::optional<unsigned> getInsertExtractIndex(const Value *Inst,
----------------
jroelofs wrote:

eh, not that weird:
```
$ git grep "template <.*> static" llvm | wc -l
     132
```

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


More information about the llvm-commits mailing list