This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Fix incorrect usage of getNumElements() in InstCombineCalls
ClosedPublic

Authored by ctetreau on May 6 2020, 3:15 PM.

Details

Summary

Remove incorrect usage of getNumElements() from visitCallInst(). The
number of elements was being used to construct a DemandedElts bitfield.
This operation does not make sense for scalable vectors. Cast to
FixedVectorType

Identified by test case Clang :: CodeGen/aarch64-sve-intrinsics/acle_sve_mla.c

Diff Detail

Event Timeline

ctetreau created this revision.May 6 2020, 3:15 PM
Herald added a reviewer: efriedma. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript

This test case also hits the call to getNumElements() at IR/Function.cpp:1184. However, there is an open diff D79416 for this call site so I've left it unresolved in this patch.

david-arm accepted this revision.May 6 2020, 11:47 PM
This revision is now accepted and ready to land.May 6 2020, 11:47 PM
This revision was automatically updated to reflect the committed changes.