OSDN Git Service

[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)
commit65f52bf60ece94d8dba609eb9ad678972bc77fc3
tree713d02d7f603287f68931f73cf600f9a9c284f78
parentb5fc14e6f818205c09eb67ed6e3b3f5a89dbea22
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318057 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/masked_gather_scatter.ll