[CostModel][X86] Add costs for multiply-by-pow2 constants
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 20 Oct 2021 12:11:21 +0000 (13:11 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 20 Oct 2021 12:11:21 +0000 (13:11 +0100)
commit5b395bd633632b9f87f4d853095cb1a090a1efe6
tree8c3b00e892297bc50a6f963bd102f76188f6225b
parentab2ca8496d54573de1c8bec204009567ba2b4086
[CostModel][X86] Add costs for multiply-by-pow2 constants

These are folded to left shifts in the backend.

We should be able to extend this for multiply-by-negpow2 after D111968 has landed to resolve PR51436
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/mul.ll