Skip to content

Commit 8c67d25

Browse files
committed
[X86] combineGatherScatter - pull out repeated variables. NFC.
1 parent e06363f commit 8c67d25

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56708,10 +56708,11 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
5670856708
SDValue Scale = GorS->getScale();
5670956709
EVT IndexVT = Index.getValueType();
5671056710
EVT IndexSVT = IndexVT.getVectorElementType();
56711+
unsigned IndexWidth = Index.getScalarValueSizeInBits();
5671156712
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
56713+
EVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
5671256714

5671356715
if (DCI.isBeforeLegalize()) {
56714-
unsigned IndexWidth = Index.getScalarValueSizeInBits();
5671556716
// Attempt to move shifted index into the address scale, allows further
5671656717
// index truncation below.
5671756718
if (Index.getOpcode() == ISD::SHL && isa<ConstantSDNode>(Scale)) {
@@ -56774,8 +56775,6 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
5677456775
}
5677556776
}
5677656777

56777-
EVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
56778-
5677956778
// Try to move splat adders from the index operand to the base
5678056779
// pointer operand. Taking care to multiply by the scale. We can only do
5678156780
// this when index element type is the same as the pointer type.
@@ -56823,8 +56822,6 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG,
5682356822
}
5682456823

5682556824
if (DCI.isBeforeLegalizeOps()) {
56826-
unsigned IndexWidth = Index.getScalarValueSizeInBits();
56827-
5682856825
// Make sure the index is either i32 or i64
5682956826
if (IndexWidth != 32 && IndexWidth != 64) {
5683056827
MVT EltVT = IndexWidth > 32 ? MVT::i64 : MVT::i32;

0 commit comments

Comments
 (0)