This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Fix problematic call to EVT::changeVectorElementType().
ClosedPublic

Authored by paulwalker-arm on Aug 8 2023, 6:40 AM.

Details

Summary

The function changeVectorElementType assumes MVT input types will
result in MVT output types. There's no gurantee this is possible
during early code generation and so this patch converts an instance
used during initial DAG construction to instead explicitly create a
new EVT.

NOTE: I could have added more MVTs, but that seemed unscalable as you can either have MVTs with 100% element count coverage or 100% bitwidth coverage, but not both.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Aug 8 2023, 6:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 6:40 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.Aug 8 2023, 6:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 6:40 AM
sdesmalen accepted this revision.Aug 8 2023, 7:10 AM

I think this is a valid fix, but it makes me wonder if we should always just pass the LLVMContext to these interfaces (e.g. changeVectorElementType and changeVectorElementTypeToInteger) so that we can do away with these subtle issues.

This revision is now accepted and ready to land.Aug 8 2023, 7:10 AM
This revision was landed with ongoing or failed builds.Aug 9 2023, 5:52 AM
This revision was automatically updated to reflect the committed changes.