Skip to content

Commit 8848766

Browse files
committed
[Codegen] TargetLowering::getCanonicalIndexType - early out scaled MVT::i8 indices. NFCI.
Avoids unused assignment scan-build warning.
1 parent b577126 commit 8848766

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7956,10 +7956,8 @@ TargetLowering::getCanonicalIndexType(ISD::MemIndexType IndexType, EVT MemVT,
79567956
(IndexType == ISD::SIGNED_SCALED) || (IndexType == ISD::SIGNED_UNSCALED);
79577957

79587958
// Scaling is unimportant for bytes, canonicalize to unscaled.
7959-
if (IsScaledIndex && MemVT.getScalarType() == MVT::i8) {
7960-
IsScaledIndex = false;
7961-
IndexType = IsSignedIndex ? ISD::SIGNED_UNSCALED : ISD::UNSIGNED_UNSCALED;
7962-
}
7959+
if (IsScaledIndex && MemVT.getScalarType() == MVT::i8)
7960+
return IsSignedIndex ? ISD::SIGNED_UNSCALED : ISD::UNSIGNED_UNSCALED;
79637961

79647962
return IndexType;
79657963
}

0 commit comments

Comments
 (0)