llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[AArch64] a redundant mov instruction compare to gcc

Open vfdff opened this issue 3 years ago • 0 comments

test case https://gcc.godbolt.org/z/5dTff475M

unsigned __int128 mul64 (unsigned __int128 mul0,
                         unsigned __int128 mul1)
{
    return (mul0 & 0xffffffffffffffff) * (mul1 & 0xffffffffffffffff);
}
  • llvm has a redundant mov instruction, can be fold into mul x0, x2, x0 if issue the umulh one step first.
        mul     x8, x2, x0
        umulh   x1, x2, x0
        mov     x0, x8   -- redundant ?

vfdff avatar Oct 17 '22 11:10 vfdff