Open hez2010 opened 5 days ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Also #101184. You should have seen it before.
There is never any dominating compare against 4, hence the JIT cannot eliminate it. Similarly, there is never a dominating compare against null that the JIT can eliminate. This requires some more general jump threading / RBO, or some form of partial redundancy elimination to improve, I think.
The CSE does happen if you manually add a dominating null check on b
so that the JIT can sort out all the redundancies.
Description
Repro:
https://godbolt.org/z/1d9Phs177
Codegen:
The JIT is generating code to compare on
string.Length
with4
again and again.Configuration
.NET main (751b2c0225c3e174f7fa0507854d4a26d733fa76)
Regression?
No