This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] During ISel try to convert G_PTR_ADD to G_ADD
ClosedPublic

Authored by aemerson on Jan 29 2020, 1:52 PM.

Details

Reviewers
paquette
Summary

This lowering tries to look for G_PTR_ADD instructions and then converts them to a standard G_ADD with a COPY on the source, and G_INTTOPTR on the result. This is ok for address space 0 on AArch64 as p0 can be treated as s64.

The motivation behind this is to expose the add semantics to the imported tablegen patterns. We shouldn't need to check for uses being loads/stores, because the selector works bottom up, uses before defs. By the time we end up trying to select a G_PTR_ADD, we should have already attempted to fold this into addressing modes and were therefore unsuccessful.

This gives some performance and code size improvements across the board.

Diff Detail

Event Timeline

aemerson created this revision.Jan 29 2020, 1:52 PM
This revision is now accepted and ready to land.Jan 29 2020, 3:11 PM
aemerson closed this revision.Jan 30 2020, 8:15 AM

Committed in 610f1d22f149 but with wrong phab link in commit msg.