[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)
commitea8885459e08fa944c2aee51c9896fe30d33d2e1
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 22 Jul 2019 12:44:10 +0000 (22 12:44 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 22 Jul 2019 12:44:10 +0000 (22 12:44 +0000)
tree2f076f5de1a2ce6e3c65e34e96a66206ad9d296c
parent33be52a9dde663507ebf790a93bb2b50fcf4969f
[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)

This patch enables us to find the source loads for each element, splitting them into a Load and ByteOffset, and attempts to recognise consecutive loads that are in fact from the same source load.

A helper function, findEltLoadSrc, recurses to find a LoadSDNode and determines the element's byte offset within it. When attempting to match consecutive loads, byte offsetted loads then attempt to matched against a previous load that has already been confirmed to be a consecutive match.

Next step towards PR16739 - after this we just need to account for shuffling/repeated elements to create a vector load + shuffle.

Fixed out of bounds load assert identified in rL366501

Differential Revision: https://reviews.llvm.org/D64551

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366681 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/clear_upper_vector_element_bits.ll
test/CodeGen/X86/load-partial.ll