[CostModel][X86] Increase i64 mul cost from 1 to 2
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 23 Sep 2021 13:48:08 +0000 (14:48 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 23 Sep 2021 13:48:21 +0000 (14:48 +0100)
commitc931d35216a320465947a5a46b158cf71024458d
treee49c4894e284a59ddb240c79c004459b05bcfdde
parentbb9333c3504a4a02b982526ad8264d14c6ec1ad4
[CostModel][X86] Increase i64 mul cost from 1 to 2

Only the most recent cpus support really 1cy 64-bit multiplies, and the X64 cost table represents a realistic worst case. The 1cy value was also discouraging vectorization when most vXi64 PMULDQ expansions aren't actually slower than scalarization.

Noticed while investigating PR51436.
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/arith-fix.ll
llvm/test/Analysis/CostModel/X86/arith-overflow.ll
llvm/test/Analysis/CostModel/X86/arith.ll
llvm/test/Analysis/CostModel/X86/rem.ll
llvm/test/Analysis/CostModel/X86/slm-arith-costs.ll
llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
llvm/test/Transforms/SLPVectorizer/X86/arith-fix.ll
llvm/test/Transforms/SLPVectorizer/X86/arith-mul.ll