Exactly what purpose does the surrounding instructions serve in this and similar simple cases? Is it compiler dogma or a missed uncommon optimization?
push rbp
mov rbp, rsp
popcnt eax, edi
pop rbp
ret