This is an archive of the discontinued LLVM Phabricator instance.

[mem2reg] Enhance to ignore @llvm.assume(icmp ne null) uses.
Needs ReviewPublic

Authored by DiamondLovesYou on Mar 2 2020, 8:23 AM.

Details

Summary

These checks should be dead after promotion, so don't block promotion because of them.

Diff Detail

Event Timeline

DiamondLovesYou created this revision.Mar 2 2020, 8:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2020, 8:23 AM
jdoerfert requested changes to this revision.Mar 2 2020, 6:51 PM
jdoerfert added subscribers: Tyker, lebedev.ri, jdoerfert.

While I see how this is generally useful, I fear the implementation goes in the wrong direction.
What I mean is that we are moving away from instruction-based encodings for assume, see for example D74209.
What we need here is basically D73832.

@Tyker @lebedev.ri Maybe lifetime markers are the second use case for the "drop users" interface (D73404).

While I see how this is generally useful, I fear the implementation goes in the wrong direction.
What I mean is that we are moving away from instruction-based encodings for assume, see for example D74209.
What we need here is basically D73832.

@Tyker @lebedev.ri Maybe lifetime markers are the second use case for the "drop users" interface (D73404).

Interesting. I see your point, and I agree. Perhaps accept this until that lands, then revert this (or just leave inplace until -mem2reg is deleted? If that's the long term plan?)? I also have another patch similar to this which ignores alignment assumptions, FYI. These missed optimizations are very expensive for a target like AMDGPU because of unnecessary stack usage.

Sadly, my use case is for Rust, which ATM is a bit behind LLVM's release cadence (they are currently on a patched 9.0; see https://github.com/rust-lang/rust/pull/67759). So, at the very least I'll have to keep this patch local until that work lands and Rust is upgraded.

Given that you want/have to keep this downstream for a while anyway, I would prefer that is all we do, though that is not to say I can't be convinced.

lebedev.ri requested changes to this revision.Jul 1 2020, 7:05 AM

Rebase now that there has been changes wrt assume handling?

This revision now requires changes to proceed.Jul 1 2020, 7:05 AM
lebedev.ri resigned from this revision.Jan 12 2023, 4:46 PM

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

This revision now requires review to proceed.Jan 12 2023, 4:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 4:46 PM
Herald added a subscriber: StephenFan. · View Herald Transcript