[SimplifyCFG] Swap to using TargetTransformInfo for cost
authorJames Molloy <james.molloy@arm.com>
Wed, 11 Feb 2015 12:15:41 +0000 (12:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 11 Feb 2015 12:15:41 +0000 (12:15 +0000)
commit4de471dd0aabb0ddb72b29c4b04729ddb88e7315
tree11c993f0bab5a4f02d15dfc34a3a9c0f5ef19505
parent7b9135922626f04652da8d8e5312fe9193d891d9
[SimplifyCFG] Swap to using TargetTransformInfo for cost
 analysis.

We're already using TTI in SimplifyCFG, so remove the hard-baked "cheapness"
heuristic and use TTI directly. Generally NFC intended, but we're using a slightly
different heuristic now so there is a slight test churn.

Test changes:
  * combine-comparisons-by-cse.ll: Removed unneeded branch check.
  * 2014-08-04-muls-it.ll: Test now doesn't branch but emits muleq.
  * coalesce-subregs.ll: Superfluous block check.
  * 2008-01-02-hoist-fp-add.ll: fadd is safe to speculate. Change to udiv.
  * PhiBlockMerge.ll: Superfluous CFG checking code. Main checks still present.
  * select-gep.ll: A variable GEP is not expensive, just TCC_Basic, according to the TTI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228826 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/CodeGen/AArch64/arm64-promote-const.ll
test/CodeGen/AArch64/combine-comparisons-by-cse.ll
test/CodeGen/ARM/2014-08-04-muls-it.ll
test/CodeGen/ARM/coalesce-subregs.ll
test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll
test/Transforms/SimplifyCFG/PhiBlockMerge.ll
test/Transforms/SimplifyCFG/select-gep.ll