This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Change the asserts in LowerToPredicatedOp to check for legal types
ClosedPublic

Authored by david-arm on Mar 9 2022, 8:04 AM.

Details

Summary

When building the LLVM test suite with SVE I discovered a crash
when compiling some Halide tests, which occurs because we try to
use SVE to lower 64-bit vector multiplies and there is no
vscale_range attribute on the function. In this case the min SVE
vector bits was 0, which caused an assert in LowerToPredicatedOp
to fire. I have amended the asserts in this function to check that the
fixed-width type is legal. If the fixed-width type is larger than NEON
and is legal then it must be because we've set the min SVE vector
bits to something > 128. Or if the min SVE bits is 0, then the only
legal types allowed are 128 bit types - for any other types the assert
will fire.

Tests added here:

CodeGen/AArch64/sve-fixed-length-no-vscale-range.ll

Diff Detail

Event Timeline

david-arm created this revision.Mar 9 2022, 8:04 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Mar 9 2022, 8:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 8:04 AM
david-arm updated this revision to Diff 414302.Mar 10 2022, 1:26 AM
david-arm retitled this revision from [AArch64][SVE] Set the default min SVE bits to 128 to [AArch64][SVE] Change the asserts in LowerToPredicatedOp to check for legal types.
david-arm edited the summary of this revision. (Show Details)
  • I have tried an alternative approach with this latest patch. Instead of changing the default min SVE vector bits to 128, I have amended the asserts in LowerToPredicatedOp to check that the fixed-width type is legal.
paulwalker-arm accepted this revision.Mar 10 2022, 4:46 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
20034

This is a target lowering function so you should be able to call isTypeLegal() directly.

This revision is now accepted and ready to land.Mar 10 2022, 4:46 AM
This revision was landed with ongoing or failed builds.Mar 11 2022, 1:58 AM
This revision was automatically updated to reflect the committed changes.