This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Disable matchSplatAsGather for i1 vectors to prevent creating illegal nodes.
ClosedPublic

Authored by craig.topper on Jun 13 2022, 12:07 PM.

Details

Summary

We were incorrectly creating a VRGATHER node with i1 vector type. We
could support this by promoting the mask to i8 and truncating it, but
for now I want to prevent the crash.

Fixes PR56007.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 13 2022, 12:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 12:07 PM
craig.topper requested review of this revision.Jun 13 2022, 12:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 12:07 PM

Use getVectorElementType() instead of getScalarType().

reames accepted this revision.Jun 13 2022, 12:29 PM

LGTM

Minor comments:

  • "promote to i1" - I think you meant i8.
  • Is this a broader problem for other types? e.g. is this a missing legality check on the VGATHER node?
This revision is now accepted and ready to land.Jun 13 2022, 12:29 PM

LGTM

Minor comments:

  • "promote to i1" - I think you meant i8.
  • Is this a broader problem for other types? e.g. is this a missing legality check on the VGATHER node?

The DAG combine caller already checks isTypeLegal. It's also called by LowerBUILD_VECTOR which should only be called for legal types. I think any legal FP type or non-i1 int type should be ok for the VRGATHER.

This revision was landed with ongoing or failed builds.Jun 13 2022, 1:41 PM
This revision was automatically updated to reflect the committed changes.