This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Simplify offset calculation for a constant GEP
ClosedPublic

Authored by sameerds on Aug 30 2022, 4:56 AM.

Diff Detail

Event Timeline

sameerds created this revision.Aug 30 2022, 4:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
sameerds requested review of this revision.Aug 30 2022, 4:56 AM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nikic added a subscriber: nikic.Aug 30 2022, 5:17 AM
nikic added inline comments.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1292

For scalable vectors this can still fail even if all indices are constant. Not sure if relevant in this context.

jdoerfert accepted this revision.Aug 30 2022, 8:51 AM

LG, one nit though as pointed out by @nikic .

llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1293

Let's allow failure for now, handling as above.

This revision is now accepted and ready to land.Aug 30 2022, 8:51 AM
sameerds updated this revision to Diff 456931.Aug 31 2022, 5:03 AM

Simpler check for constant offset. We don't really care if the indices are constant.