OSDN Git Service

[ConstHoist] Do not rebase single (or few) dependent constant
authorZhaoshi Zheng <zhaoshiz@coduaurora.org>
Tue, 25 Sep 2018 17:45:37 +0000 (17:45 +0000)
committerZhaoshi Zheng <zhaoshiz@coduaurora.org>
Tue, 25 Sep 2018 17:45:37 +0000 (17:45 +0000)
commit0d75a2849cb904fca6995372bd8917fc700e083b
tree6c52e98b4b81e217965b6c6404f3f5872f0cd2cc
parent7a725b21869ad0a38252c8a2f63f69dc2b4adf43
[ConstHoist] Do not rebase single (or few) dependent constant

If an instance (InsertionPoint or IP) of Base constant A has only one or few
rebased constants depending on it, do NOT rebase. One extra ADD instruction is
required to materialize each rebased constant, assuming A and the rebased have
the same materialization cost.

Differential Revision: https://reviews.llvm.org/D52243

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342994 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/ConstantHoisting.cpp
test/CodeGen/Thumb/consthoist-few-dependents.ll [new file with mode: 0644]