This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix incorrect usage of getPrimitiveSizeInBits when we should be using the element size for vectors
ClosedPublic

Authored by craig.topper on Sep 11 2018, 10:08 AM.

Details

Summary

For vectors, getPrimitiveSizeInBits returns the full vector width. This code should using the element size for vectors. This could be fixed by calling getScalarSizeInBits, but its even easier to just get it from the APInt we're checking.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 11 2018, 10:08 AM
spatel accepted this revision.Sep 11 2018, 10:40 AM

LGTM

This revision is now accepted and ready to land.Sep 11 2018, 10:40 AM
This revision was automatically updated to reflect the committed changes.