OSDN Git Service

[SelectionDAG][X86] Explicitly store the scale in the gather/scatter ISD nodes
authorCraig Topper <craig.topper@intel.com>
Wed, 10 Jan 2018 19:16:05 +0000 (19:16 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 10 Jan 2018 19:16:05 +0000 (19:16 +0000)
commit703dd67544fdbd3c89d3f52246233ba49d7aff04
treeee15a7552d238f7b829865f647af6a96523d72fe
parent4f319f2682c6881c5d1e67260bc098c4de0e5023
[SelectionDAG][X86] Explicitly store the scale in the gather/scatter ISD nodes

Currently we infer the scale at isel time by analyzing whether the base is a constant 0 or not. If it is we assume scale is 1, else we take it from the element size of the pass thru or stored value. This seems a little weird and I think it makes more sense to make it explicit in the DAG rather than doing tricky things in the backend.

Most of this patch is just making sure we copy the scale around everywhere.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322210 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/masked_gather_scatter.ll