Skip to content

Commit

Permalink
[Codegen] TargetLowering::getCanonicalIndexType - early out scaled MV…
Browse files Browse the repository at this point in the history
…T::i8 indices. NFCI.

Avoids unused assignment scan-build warning.
  • Loading branch information
RKSimon committed Oct 14, 2021
1 parent b577126 commit 8848766
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Expand Up @@ -7956,10 +7956,8 @@ TargetLowering::getCanonicalIndexType(ISD::MemIndexType IndexType, EVT MemVT,
(IndexType == ISD::SIGNED_SCALED) || (IndexType == ISD::SIGNED_UNSCALED);

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

return IndexType;
}
Expand Down

0 comments on commit 8848766

Please sign in to comment.