This is an archive of the discontinued LLVM Phabricator instance.

GlobalOpt: Drop code to handle typed pointers
ClosedPublic

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

Details

Summary

Fixes assert with pointers with different address spaces. We
could keep looking through addrspacecast, but it would require
checking for null handling of the access address space.

Fixes #62384

Diff Detail

Event Timeline

arsenm created this revision.Apr 26 2023, 1:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 1:40 PM
arsenm requested review of this revision.Apr 26 2023, 1:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 1:40 PM
Herald added a subscriber: wdng. · View Herald Transcript
nikic added inline comments.Apr 26 2023, 1:42 PM
llvm/test/Transforms/GlobalOpt/issue62384.ll
3

Why does this need ipsccp and called-value-propagation?

arsenm added inline comments.Apr 26 2023, 1:43 PM
llvm/test/Transforms/GlobalOpt/issue62384.ll
3

Not really sure but this was as small as I could get the opt pipeline

aeubanks added inline comments.Apr 26 2023, 1:49 PM
llvm/test/Transforms/GlobalOpt/issue62384.ll
3

you should be able to dump the IR right before globalopt with something like -print-before-all

arsenm added inline comments.Apr 26 2023, 1:54 PM
llvm/test/Transforms/GlobalOpt/issue62384.ll
3

Of course that's what I first did, but it still did not reproduce with just globalopt at that point. The constantexpr cast moved into init0 after IPSCCP

nikic added inline comments.Apr 26 2023, 1:57 PM
llvm/test/Transforms/GlobalOpt/issue62384.ll
3

This may be related to either use list order, or to dangling constant expressions.

arsenm updated this revision to Diff 517315.Apr 26 2023, 2:19 PM

Reproduces without other passes now for some reason

jhuber6 accepted this revision.Apr 26 2023, 6:55 PM
This revision is now accepted and ready to land.Apr 26 2023, 6:55 PM
fhahn accepted this revision.Apr 27 2023, 4:34 AM

LGTM, thanks!