[X86] EltsFromConsecutiveLoads - support common source loads
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 18 Jul 2019 14:33:25 +0000 (14:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 18 Jul 2019 14:33:25 +0000 (14:33 +0000)
commit48104ef7c9c653bbb732b66d7254957389fea337
treee28afb41be74b0135c3a7dfcc3d55866470b31e0
parent64becc11a87a6bf2328550009f3c09a807d36931
[X86] EltsFromConsecutiveLoads - support common source loads

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.

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

llvm-svn: 366441
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/clear_upper_vector_element_bits.ll
llvm/test/CodeGen/X86/load-partial.ll