This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Add tests for upcoming fixes to pointer/index type confusion.
ClosedPublic

Authored by krzysz00 on Feb 6 2023, 1:49 PM.

Details

Summary

Various parts of the codebase are using getIntPtrType() and its
relatives when getting the type of the offset argument to GEP. Most
such code has been updated to use the pointer index type field from
the data layout, but there is code that still assumes these two types
are the same in certain optimizaiton passes.

This commit adds regression tests to capture the old behavior.

Diff Detail

Event Timeline

krzysz00 created this revision.Feb 6 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 1:49 PM
Herald added a subscriber: arphaman. · View Herald Transcript
krzysz00 requested review of this revision.Feb 6 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 1:49 PM
krzysz00 added a reviewer: Restricted Project.Feb 6 2023, 1:49 PM
arsenm accepted this revision.Feb 7 2023, 5:24 AM
arsenm added a subscriber: arsenm.
arsenm added inline comments.
llvm/test/Transforms/SeparateConstOffsetFromGEP/pointer-type-not-offset-type.ll
15

Probably should include cases where the offset is larger too

This revision is now accepted and ready to land.Feb 7 2023, 5:24 AM