This is an archive of the discontinued LLVM Phabricator instance.

Make AddrSpaceCast noops on PPC
ClosedPublic

Authored by vchuravy on Feb 26 2018, 1:17 PM.

Details

Summary

PPC as AArch64 doesn't have address-spaces so we can drop them in the backend

Diff Detail

Repository
rL LLVM

Event Timeline

vchuravy created this revision.Feb 26 2018, 1:17 PM

This seems like a perfectly reasonable thing to do. However, I'd like to understand the implications of this change - does anything change behaviour as a result? If so, can we have a test case? If not, does this just save compile time (i.e. we don't insert casts that will just be cleaned up anyway)? Even if the change is only internal to the SDAG processing and the final code doesn't change, would it be possible to have an MIR test case that shows the difference?

vchuravy updated this revision to Diff 138923.Mar 19 2018, 7:41 AM

add tests for addrspaces noops on PPC

vchuravy updated this revision to Diff 138926.Mar 19 2018, 7:49 AM

fix typos

@nemanjai I added two test cases the first taken from ARM.addrspacecast.ll and the second from a bug that the Julia frontend hit.

It should be a non-functional change for the backend itself.

nemanjai accepted this revision.Mar 19 2018, 8:17 AM

LGTM.

test/CodeGen/PowerPC/addrspacecast.ll
1 ↗(On Diff #138926)

I'm not sure how /dev/null works for targets I'm not familiar with (like Windows). Is this a common thing to do?
It might not be a terrible thing to actually do < %s | FileCheck %s and then maybe just a CHECK-LABEL to verify we've actually generated assembly.

But in either case, I assume that lit checks for the return code from the llc invocation, so I'm fine either way.

This revision is now accepted and ready to land.Mar 19 2018, 8:17 AM
vchuravy updated this revision to Diff 138950.Mar 19 2018, 9:06 AM

update tests to use FileCheck

vchuravy marked an inline comment as done.Mar 19 2018, 9:07 AM

Thanks! Can you land this for me I don't have the commit bit.

test/CodeGen/PowerPC/addrspacecast.ll
1 ↗(On Diff #138926)

Yeah this seems fairly standard and was taken from the ARM/addrspacecast.ll
But I can use FileCheck and CHECK-LABEL to do the same

This revision was automatically updated to reflect the committed changes.