[CostModel][TTI] Fix ops used for generic smulo/umulo cost expansion
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 17:30:05 +0000 (18:30 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 6 Oct 2021 18:11:32 +0000 (19:11 +0100)
commit7bd097fd1e4a76060a19f1e28b0e3a6b3e035132
tree15f7a72a88c842eb6ed56c3583032f11ef0a5a38
parent81b5da8c97463839d5631628f9687e26dcca467f
[CostModel][TTI] Fix ops used for generic smulo/umulo cost expansion

Fix copy+pasta that was checking for smul_fix instead of smul_with_overflow to detected signed values.

The LShr is performed on the extended type as we use it to truncate+extract the upper/hi bits of the extended multiply.

More closely matches the default expansion from TargetLowering::expandMULO
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/test/Analysis/CostModel/ARM/arith-overflow.ll
llvm/test/Analysis/CostModel/X86/arith-overflow.ll
llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll