These checks should be dead after promotion, so don't block promotion because of them.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.