This is an archive of the discontinued LLVM Phabricator instance.

R600/SI: Fix offset folding in some cases with shifted pointers.
ClosedPublic

Authored by arsenm on Aug 5 2014, 12:18 PM.

Details

Reviewers
arsenm
Summary

Ordinarily (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
is only done if the add has one use. If the resulting constant
add can be folded into an addressing mode, force this to happen
for the pointer operand.

This ends up happening a lot because of how LDS objects are allocated.
Since the globals are allocated next to each other, acessing the first
element of the second object is directly indexed by a shifted pointer.

Depends on:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140728/229124.html

Diff Detail

Event Timeline

arsenm updated this revision to Diff 12208.Aug 5 2014, 12:18 PM
arsenm retitled this revision from to R600/SI: Fix offset folding in some cases with shifted pointers. .
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a subscriber: Unknown Object (MLST).
arsenm accepted this revision.Aug 15 2014, 10:58 AM
arsenm added a reviewer: arsenm.

r215739. I XFAILed the test since it also tests the other generic DAG combiner patch to do this with only 1 use

This revision is now accepted and ready to land.Aug 15 2014, 10:58 AM
arsenm closed this revision.Aug 15 2014, 10:58 AM