[llvm] [LSV] Insert casts to vectorize mismatched types (PR #134436)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 01:33:17 PDT 2025


================
@@ -1310,6 +1315,116 @@ std::optional<APInt> Vectorizer::getConstantOffsetSelects(
   return std::nullopt;
 }
 
+void Vectorizer::insertCastsToMergeClasses(EquivalenceClassMap &EQClasses) {
+  if (EQClasses.size() < 2)
+    return;
+
+  // For each class, determine if all instructions are of type int, FP or ptr.
+  // This information will help us determine the type instructions should be
+  // casted into.
+  MapVector<EqClassKey, Bitset<3>> ClassAllTy;
+  for (auto C : EQClasses) {
+    if (all_of(EQClasses[C.first], [](Instruction *I) {
----------------
arsenm wrote:

const 

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


More information about the llvm-commits mailing list