summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-11-22 08:10:54 +0000
committerCraig Topper <craig.topper@intel.com>2017-11-22 08:10:54 +0000
commitee74044f9301a6c658e1435b9cf5c05aa1284002 (patch)
tree2299f37207499c666c8e76f4eb26a9b67fdf483f /llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
parent860a7b790154718fa509e81a70f10435719b8a5a (diff)
downloadbcm5719-llvm-ee74044f9301a6c658e1435b9cf5c05aa1284002.tar.gz
bcm5719-llvm-ee74044f9301a6c658e1435b9cf5c05aa1284002.zip
[X86] Add an X86ISD::MSCATTER node for consistency with the X86ISD::MGATHER.
This makes the fact that X86 needs an explicit mask output not part of the type constraint for the ISD::MSCATTER. This also gives the X86ISD::MGATHER/MSCATTER nodes a common base class simplifying the address selection code in X86ISelDAGToDAG.cpp llvm-svn: 318823
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelDAGToDAG.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 71ae97d7e92..504482a5e2a 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1522,14 +1522,9 @@ bool X86DAGToDAGISel::selectVectorAddr(SDNode *Parent, SDValue N, SDValue &Base,
SDValue &Scale, SDValue &Index,
SDValue &Disp, SDValue &Segment) {
X86ISelAddressMode AM;
- if (auto Mgs = dyn_cast<MaskedGatherScatterSDNode>(Parent)) {
- AM.IndexReg = Mgs->getIndex();
- AM.Scale = Mgs->getValue().getScalarValueSizeInBits() / 8;
- } else {
- auto X86Gather = cast<X86MaskedGatherSDNode>(Parent);
- AM.IndexReg = X86Gather->getIndex();
- AM.Scale = X86Gather->getValue().getScalarValueSizeInBits() / 8;
- }
+ auto *Mgs = cast<X86MaskedGatherScatterSDNode>(Parent);
+ AM.IndexReg = Mgs->getIndex();
+ AM.Scale = Mgs->getValue().getScalarValueSizeInBits() / 8;
unsigned AddrSpace = cast<MemSDNode>(Parent)->getPointerInfo().getAddrSpace();
// AddrSpace 256 -> GS, 257 -> FS, 258 -> SS.
OpenPOWER on IntegriCloud