[PATCH] D93610: [LegalizeType] When LegalizeType procedure widens a masked_gather, set MemoryType's EltNum equal to Result's EltNum

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 18:57:37 PST 2020


yubing added a comment.

In D93610#2467210 <https://reviews.llvm.org/D93610#2467210>, @craig.topper wrote:

> LGTM



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:4906
+    // Widen the MemoryType
+    WideMemVT = EVT::getVectorVT(*DAG.getContext(),
+                                 MSC->getMemoryVT().getScalarType(), NumElts);
----------------
craig.topper wrote:
> yubing wrote:
> > craig.topper wrote:
> > > This needs to be widened for OpNo == 4 as well otherwise it would have a different element count.
> > Eh, You mean we should make MemType's EltNum equal to index's EltNum instead of ResultType's EltNum?
> > But in fact, index and result can have different element number and index's upper element is ignored as mentioned in https://reviews.llvm.org/D51337.
> Oh you're right. I forgot that was allowed now. It used to not be in the original implementation. So disregard.
Anyway, we solve the bug, cheers~


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93610



More information about the llvm-commits mailing list