[SelectionDAG] fold 'Op0 - (X * MulC)' to 'Op0 + (X << log2(-MulC))'
authorPing Deng <Ping.Deng@streamcomputing.com>
Wed, 15 Jun 2022 05:43:26 +0000 (05:43 +0000)
committerBen Shi <ben.shi@streamcomputing.com>
Wed, 15 Jun 2022 05:50:18 +0000 (05:50 +0000)
commitc06f77ec0d38163a67c26ddf847adc58f82f9672
tree9d319ee6044127a4616e4d203263e6f54df96101
parent2eafb96289da2993f65ae848a27648b3b8ebe89c
[SelectionDAG] fold 'Op0 - (X * MulC)' to 'Op0 + (X << log2(-MulC))'

Reviewed By: craig.topper, spatel

Differential Revision: https://reviews.llvm.org/D127474
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/RISCV/mul.ll