This is an archive of the discontinued LLVM Phabricator instance.

[Transforms/Scalar/SeparateConstOffsetFromGEP] Add the extracted offset using GEP
ClosedPublic

Authored by jingyue on May 22 2014, 3:56 PM.

Details

Reviewers
eliben
hfinkel
Summary

Fixed a TODO in the original code.

We add the extracted constant offset using GEP instead of ugly ptrtoint+add+inttoptr. Using GEP simplifies future optimizations and makes IR easier to understand.

Updated all affected tests, and added a new test in split-gep.ll to cover a corner case where uglygep is necessary.

Diff Detail

Event Timeline

jingyue updated this revision to Diff 9720.May 22 2014, 3:56 PM
jingyue retitled this revision from to [Transforms/Scalar/SeparateConstOffsetFromGEP] Add the extracted offset using GEP.
jingyue updated this object.
jingyue edited the test plan for this revision. (Show Details)
jingyue added reviewers: eliben, hfinkel.
jingyue added a subscriber: Unknown Object (MLST).
eliben accepted this revision.May 23 2014, 9:25 AM
eliben edited edge metadata.

LGTM

lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
552–555

Maybe still mention uglygep here, since you mention it later?

This revision is now accepted and ready to land.May 23 2014, 9:25 AM
jingyue updated this revision to Diff 9764.May 23 2014, 9:49 AM
jingyue edited edge metadata.

Sounds good. Thanks! Updated the comment.

jingyue closed this revision.May 23 2014, 11:47 AM

Committed revision 209537.