This is an archive of the discontinued LLVM Phabricator instance.

[GlobalOpt] Delete write-only constants with cast users
Needs RevisionPublic

Authored by jdoerfert on Apr 3 2021, 1:07 PM.

Details

Summary

We handled constant bit/addrspace-casts and GEPs but no
bit/addrspace-cast instructions before.

Diff Detail

Event Timeline

jdoerfert created this revision.Apr 3 2021, 1:07 PM
jdoerfert requested review of this revision.Apr 3 2021, 1:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2021, 1:07 PM
Herald added a subscriber: wdng. · View Herald Transcript
lebedev.ri accepted this revision.Apr 3 2021, 1:12 PM

LGTM

llvm/lib/Transforms/IPO/GlobalOpt.cpp
330

Recursion within worklist, really?!

llvm/test/Transforms/GlobalOpt/writeonly-internal-bitcast.ll
2

Precommit?

This revision is now accepted and ready to land.Apr 3 2021, 1:12 PM
jdoerfert updated this revision to Diff 335104.Apr 3 2021, 1:38 PM

Check for pointer type, ptr2int test

lebedev.ri resigned from this revision.Jan 12 2023, 5:42 PM

This review seems to be stuck/dead, consider abandoning if no longer relevant.

This revision now requires review to proceed.Jan 12 2023, 5:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 5:42 PM
arsenm requested changes to this revision.Aug 17 2023, 4:07 PM
arsenm added inline comments.
llvm/lib/Transforms/IPO/GlobalOpt.cpp
326–328

This is less useful with pointer bitcasts effectively gone. Is this still interesting if restricted to addrspacecast?

llvm/test/Transforms/GlobalOpt/writeonly-internal-bitcast.ll
35

May need a test with addrspacecast

This revision now requires changes to proceed.Aug 17 2023, 4:07 PM