This is an archive of the discontinued LLVM Phabricator instance.

[ConstraintElimination] Do not crash on vector GEP in decomposeGEP
ClosedPublic

Authored by bjope on Nov 1 2022, 11:57 AM.

Details

Summary

Commit 359bc5c541ae4b02 caused
Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"'
failures in decomposeGEP when the GEP pointer operand is a vector.

Fix is to use DataLayout::getIndexTypeSizeInBits when fetching the
index size, as it will use the scalar type in case of a ptr vector.

Diff Detail

Event Timeline

bjope created this revision.Nov 1 2022, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2022, 11:57 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
bjope requested review of this revision.Nov 1 2022, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2022, 11:57 AM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 2 2022, 2:05 AM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Nov 2 2022, 5:45 AM

Thanks! I'll extend the test coverage a bit.