Open e00E opened 3 years ago
If you look at the emitted mir, I think what's causing this is that an extra temporary is used to store the enum type and is not const
as is marked in next0
. I'm curious why the 2nd implementation doesn't have E::E1-3
marked as const?
Upstream issue: https://github.com/llvm/llvm-project/issues/63876
https://godbolt.org/z/fYfohcsax
Optimized assembly on stable 1.52.0 and nightly:
I expected next1 to compile to the same assembly as next0.
Edit 2022-12-01: Not fixed on current stable 1.65 and nightly.