[PATCH] D98240: [VectorCombine] Simplify to scalar store if only one element updated

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 12 20:10:01 PDT 2021


qiucf added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:795
+             m_InsertElt(m_Instruction(Source), m_Value(NewElement),
+                         m_Constant(Idx))))
+    return false;
----------------
fhahn wrote:
> Why only allow constants here? If the index is a non-constant, it should be even more profitable, because most targets probably do not have instructions to insert at a variable index.
Good catch. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98240/new/

https://reviews.llvm.org/D98240



More information about the llvm-commits mailing list