[PATCH] D72361: [DAGCombiner] reduce extract subvector of concat

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 06:34:56 PST 2020


spatel marked an inline comment as done.
spatel added a comment.

In D72361#1809619 <https://reviews.llvm.org/D72361#1809619>, @RKSimon wrote:

> LGTM - some of NFC refactoring as pre-commits would make sense to separate it from the new features.


Thanks - yes, I'll push the cosmetic cleanup and update here.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:18576
+    unsigned ExtNumElts = NVT.getVectorNumElements();
+    assert(ExtIdx % ExtNumElts == 0 &&
+           "Extract index is not a multiple of the input vector length.");
----------------
RKSimon wrote:
> If we're peeking into any concat can we guarantee this or should we just wrap in an if() instead?
This is an edit of the existing assert, and IIUC, it's independent of the concat. We are asserting that the extract_subvector conforms with its definition:

    /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
    /// vector value) starting with the element number IDX, which must be a
    /// constant multiple of the result vector length.



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

https://reviews.llvm.org/D72361





More information about the llvm-commits mailing list