[X86] Allow X86ISD::Wrapper to be folded into the base of gather/scatter address
authorCraig Topper <craig.topper@intel.com>
Mon, 13 Nov 2017 17:53:59 +0000 (17:53 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 13 Nov 2017 17:53:59 +0000 (17:53 +0000)
commitc314f461ddbb45b21b8f1f3c5c58f4eb367e8b8d
treef2464aed8507c1045312b3b8fba5bd6712a0ce21
parentf902e467b75671d06d1e9ad3663b8aa9366bc14b
[X86] Allow X86ISD::Wrapper to be folded into the base of gather/scatter address

If the base of our gather corresponds to something contained in X86ISD::Wrapper we should be able to fold it into the address.

This patch refactors some of the address matching to more fully use the X86ISelAddressMode struct and the getAddressOperands helper. A new helper function matchVectorAddress is added to call matchWrapper or fall back to matchAddressBase.

We should also be able to support constant offsets from a wrapper, but I'll look into that in a future patch. We may even be able to completely reuse matchAddress here, but I wanted to start simple and work up to it.

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

llvm-svn: 318057
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/masked_gather_scatter.ll