[llvm-bugs] [Bug 39368] New: Add EXTRACT/INSERT_SUBVECTOR support to TTI::getShuffleCost

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 20 10:09:01 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39368

            Bug ID: 39368
           Summary: Add EXTRACT/INSERT_SUBVECTOR support to
                    TTI::getShuffleCost
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: a.bataev at hotmail.com, llvm-bugs at lists.llvm.org,
                    spatel+llvm at rotateright.com

The default horizontal reduction costs depend on EXTRACT_SUBVECTOR shuffle
costs, but we barely have support for these in the TTIs.

Several issues need to be addressed:

1 - correct identification of EXTRACT/INSERT_SUBVECTOR shufflevector patterns
in ShuffleVectorInst - we've ignored length changing shuffles so far.

EXTRACT is easy, just look for an unary sequential shuffle (I don't think we
need it to be subvector aligned - just include it in the getShuffleCost index
argument).

INSERT is trickier as we need to determine what the size of the subvector was,
so we need to search the IR for the source.

2 - Fix use of Index and SubTy in getShuffleCost calls - AFAICT the Index
should indicate the extraction/insertion point of the subvector and SubTy
should always refer to the subvector type (and Ty should refer to the larger
vector type - which for EXTRACT isn't the destination type).

3 - Add SK_InsertSubvector/SK_ExtractSubvector support to
BasicTTIImpl::getShuffleCosts similar to getPermuteShuffleOverhead.

4 - Add SK_InsertSubvector/SK_ExtractSubvector support to targets - X86 in
particular as the XMM/YMM/ZMM instructions have the most use for them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181020/1d63a099/attachment.html>


More information about the llvm-bugs mailing list