This is an archive of the discontinued LLVM Phabricator instance.

[GlobalOpt] Bail out on SROA of a Global if a scalable vector type is seen
ClosedPublic

Authored by cameron.mcinally on Aug 22 2022, 3:13 PM.

Details

Summary

This is more a bug report than an earnest patch. The GlobalOpt pass is ICE'ing on scalable vector types. I've included a little patch to bail out if a scalable type is seen, but I'm not sure if that's still the current best practice for handling passes that haven't been updated for scalable vector types.

If this patch is acceptable, I'll be happy to commit the change...

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 3:13 PM
cameron.mcinally requested review of this revision.Aug 22 2022, 3:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 3:13 PM

Bailing out seems reasonable: we can't actually tell how many bytes a scalable load/store is touching, so the normal SRA algorithm won't work. Maybe more intuitive to put the bailout in collectSRATypes().

Not sure why you're sticking the test in llvm/test/CodeGen/AArch64 instead of llvm/test/Transforms/GlobalOpt/. (If you need TargetTransformInfo, you can make a subfolder llvm/test/Transforms/GlobalOpt/AArch64, but I suspect you don't.)

Not sure why you're sticking the test in llvm/test/CodeGen/AArch64 instead of llvm/test/Transforms/GlobalOpt/.

Good call, @efriedma. I was in SVE mode and not thinking. Patch updated.

This revision is now accepted and ready to land.Aug 23 2022, 3:30 PM
Matt added a subscriber: Matt.Aug 23 2022, 4:25 PM
cameron.mcinally updated this revision to Diff 455229.EditedAug 24 2022, 8:50 AM

Apologies, @efriedma. I've updated the patch again to move the check into collectSRATypes(). Would you mind doing one more review?