Open
Description
The Clang optimizer fails to generate equally efficient assembly for semantically equivalent expressions. The function sub_bytes() produces less optimal code than its logically equivalent counterpart sub_bytes_alt() or a version manually restructured to match optimized assembly.
Clang should recognize the algebraic equivalence of the expressions in sub_bytes() and optimize them the same way it does for sub_bytes_alt() or sub_bytes_asm().
Compiler Explorer: https://godbolt.org/z/rscej9nds