HomePhabricator

[SVE][InstCombine] Fix TypeSize warning in canReplaceGEPIdxWithZero

Authored by joechrisellis on Oct 26 2020, 10:40 AM.

Description

[SVE][InstCombine] Fix TypeSize warning in canReplaceGEPIdxWithZero

The warning would fire when calling canReplaceGEPIdxWithZero on a GEP
whose source element type is a scalable vector. The size of scalable
vector types is not known, so this optimization cannot be performed.

This patch fixes the issue by:

  • bailing out early in this routine if the GEP instruction's source element type is a scalable vector.
  • making use of getFixedSize -- this removes the dependency on the deprecated interface.

Reviewed By: fpetrogalli

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