[llvm] [VectorCombine] Combine scalar fneg with insert/extract to vector fneg when length is different (PR #115209)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 14:31:33 PST 2024


================
@@ -682,7 +682,8 @@ bool VectorCombine::foldInsExtFNeg(Instruction &I) {
   std::iota(Mask.begin(), Mask.end(), 0);
   Mask[Index] = Index + NumElts;
 
-  Type *ScalarTy = VecTy->getScalarType();
+  Type *ScalarTy = SrcVecTy->getScalarType();
----------------
RKSimon wrote:

Move this up and avoid the repeated SrcVecTy->getScalarType()

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


More information about the llvm-commits mailing list