[PATCH] D54803: [x86] promote all multiply i8 by constant to i32

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 21 09:28:02 PST 2018


craig.topper added a comment.

This makes some sense to me. There is no 8-bit multiply with immediate instruction anyway, so we have to load the constant in a register. And the 8-bit multiply instruction has bad register allocation constraints. On Intel CPUs the 8-bit multiply with 16-bit result in AL/AH is the same latency/throughput as a 32-bit multiply with 32-bit result. The annoying thing is that we sometimes emit an explicit movzbl for the anyextend i8->i32 to do the promotion and prevent a partial register access. We explicitly don't do that for i16->i32 any extend due to the heavy promotion of i16 types.


https://reviews.llvm.org/D54803





More information about the llvm-commits mailing list