This is an archive of the discontinued LLVM Phabricator instance.

Allow bitcast + struct GEP transform to work with addrspacecast
ClosedPublic

Authored by arsenm on Jul 14 2014, 10:10 PM.

Details

Reviewers
rnk
Summary

Make getelementptr (addrspacecast (bitcast X)) behave similarly to getelementptr (bitcast X)

Diff Detail

Event Timeline

arsenm updated this revision to Diff 11417.Jul 14 2014, 10:10 PM
arsenm retitled this revision from to Allow bitcast + struct GEP transform to work with addrspacecast.
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a subscriber: Unknown Object (MLST).
mjacob added a subscriber: mjacob.Jul 18 2014, 12:19 PM
rnk accepted this revision.Aug 11 2014, 4:59 PM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

lgtm

lib/Transforms/InstCombine/InstructionCombining.cpp
1678

Indentation seems off, but it could be phab.

1715

I guess it depends on your perspective, but I consider the addrspacecast case exceptional, so I'd handle it first and return early for it.

1733

Ditto with this condition.

This revision is now accepted and ready to land.Aug 11 2014, 4:59 PM
arsenm closed this revision.Aug 12 2014, 12:55 PM

Committed with comment formatting fixed + inverted conditions in r215467