OSDN Git Service

[ARM] Fix 28282: cost computation for constant hoisting
authorWeiming Zhao <weimingz@codeaurora.org>
Tue, 28 Jun 2016 22:30:45 +0000 (22:30 +0000)
committerWeiming Zhao <weimingz@codeaurora.org>
Tue, 28 Jun 2016 22:30:45 +0000 (22:30 +0000)
commit98f00b718bd70b94f8a45b4b48e5b25749ec5df3
tree48c2f91815d9a3fc436db2479e15366a753bc008
parentba713e39b332989964a103ec9bdd0bc58be9accd
[ARM] Fix 28282: cost computation for constant hoisting

Summary:
This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=28282

Currently the cost model of constant hoisting checks the bit width of the data type of the constants.
However, the actual immediate value is small enough and not need to be hoisted.
This patch checks for the actual bit width needed for the constant.

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: http://reviews.llvm.org/D21668

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274073 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMTargetTransformInfo.cpp
test/Transforms/ConstantHoisting/ARM/bad-cases.ll