This is an archive of the discontinued LLVM Phabricator instance.

SLSR: Pass address space to isLegalAddressingMode
ClosedPublic

Authored by arsenm on Jun 9 2015, 11:17 AM.

Details

Reviewers
jingyue
Summary

This only updates one of the uses. The other is used in cases
that may never touch memory, so I'm not sure why this is even
calling it. Perhaps there should be a new, similar hook for such
cases or pass -1 for unknown address space.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 27384.Jun 9 2015, 11:17 AM
arsenm retitled this revision from to SLSR: Pass address space to isLegalAddressingMode.
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a reviewer: jingyue.
arsenm added a subscriber: Unknown Object (MLST).
jingyue accepted this revision.Jun 9 2015, 11:39 AM
jingyue edited edge metadata.

LGTM.

Some architectures (rarely GPUs I assume) can fold multiple regular integer operations into one pointer arithmetic instruction (such as leal in x86). The other place handles that case. I think, for that scenario, it is safe to assume AS = 0 for now. Otherwise, you'd iterate through all address spaces to find any one in which the integer arithmetics can be folded into address computation.

test/Transforms/StraightLineStrengthReduce/R600/reassociate-geps-and-slsr-addrspace.ll
108

I'd add an EOL just to be consistent with other files in the LLVM tree.

This revision is now accepted and ready to land.Jun 9 2015, 11:39 AM
arsenm closed this revision.Jun 11 2015, 9:18 AM

r239540