[RISCV] Disable constant hoisting for multiply by negated power of 2.
authorCraig Topper <craig.topper@sifive.com>
Wed, 27 Jul 2022 16:33:45 +0000 (09:33 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 27 Jul 2022 16:37:59 +0000 (09:37 -0700)
commit9b27d13204969bfb57ef408ec2c95e5b1f63fc43
treea7c9af1be9ddac9a133d3330cad8d37aae456486
parentf38ea84a9f32058f3c2813b6f29b840c59de118c
[RISCV] Disable constant hoisting for multiply by negated power of 2.

A mul by a negated power of 2 is a slli followed by neg. This doesn't
require any constant materialization and may be lower latency than mul.
The neg may also be foldable into other arithmetic.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D130047
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/test/Transforms/ConstantHoisting/RISCV/immediates.ll