This is an archive of the discontinued LLVM Phabricator instance.

[SeparateConstOffsetFromGEP] Remove TypeSize error when collecting constant indices.
ClosedPublic

Authored by paulwalker-arm on Dec 16 2022, 10:15 AM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2022, 10:15 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.Dec 16 2022, 10:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2022, 10:15 AM
arsenm added a subscriber: arsenm.Dec 16 2022, 10:26 AM
arsenm added inline comments.
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
1014

Is there not a way to directly check isScalable on the type without going through getTypeAllocSize?

arsenm added inline comments.Dec 16 2022, 10:27 AM
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
1014

Looks like we're missing isScalableVectorTy, it should be there

Updated to check for scalable vector types rather that scalable sizes.

paulwalker-arm added inline comments.Dec 16 2022, 2:04 PM
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
1014

I guess I was trying to be future proof. However, currently scalable vectors cannot be in arrays and struct support is purely in register and thus cannot be indexed via getelementptr.

If this changes then the same TypeSize error will be triggered as was the case for the scenario this patch fixes.

arsenm added inline comments.Dec 16 2022, 2:12 PM
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
1014

I don't see how that could change. Even then there should be a predicate for that. I'd prefer to stick to a direct type check

arsenm accepted this revision.Dec 16 2022, 2:23 PM
This revision is now accepted and ready to land.Dec 16 2022, 2:23 PM