This is an archive of the discontinued LLVM Phabricator instance.

GlobalOpt: Drop code for handling pointer bitcasts
ClosedPublic

Authored by arsenm on Apr 26 2023, 1:43 PM.

Diff Detail

Event Timeline

arsenm created this revision.Apr 26 2023, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 1:43 PM
arsenm requested review of this revision.Apr 26 2023, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 1:43 PM
Herald added a subscriber: wdng. · View Herald Transcript
nikic added a comment.Apr 29 2023, 8:59 AM

Won't this also remove the ability to look through addrspacecasts?

Won't this also remove the ability to look through addrspacecasts?

Yes, but I'm not entirely sure that's a bad thing. We're certainly missing test coverage for this.

If we have a null pointer in addrspace(0), cast to a non-0 address space pointer and accessed, can we assume it would trap? My interpretation of the LangRef is ptr addrspace(0) null cannot be addrspacecasted to produce a dereferenceable result so this would be OK (so long as it's not a volatile access)

arsenm planned changes to this revision.Apr 29 2023, 1:11 PM

Should restrict this to just addrspacecast. Plus there's some other bitcast handling code to trim

aeubanks accepted this revision.May 1 2023, 1:05 PM

lgtm

This revision is now accepted and ready to land.May 1 2023, 1:05 PM

Apparently I got confused and closed the wrong revision, this is really f3059e223dc137ee4111f6e3bb45e7613d6ff7d5