[llvm] [SLP]Keep externally used GEPs as GEPs, if possible instead of extractelement. (PR #88877)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 06:50:01 PDT 2024


================
@@ -10033,12 +10040,40 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
         }
       }
     }
+    // Leave the GEPs as is, they are free in most cases and better to keep them
+    // as GEPs.
+    TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
----------------
alexey-bataev wrote:

To use it in TTI->getInstructionCost for adding an extra cost for the scalar GEP, which we're going to keep

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


More information about the llvm-commits mailing list