Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.
authorChad Rosier <mcrosier@codeaurora.org>
Mon, 23 Feb 2015 19:15:16 +0000 (19:15 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Mon, 23 Feb 2015 19:15:16 +0000 (19:15 +0000)
commit6229219f7e7125b73bbc18b164a482e4178a8bed
treebe7b5bc1bda0d0b05c13a57af0011455f737f2b9
parent3986322604e756eb762efd5a0610a58b206b62b3
Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.

This patch adds the isProfitableToHoist API.  For AArch64, we want to prevent a
fmul from being hoisted in cases where it is more profitable to form a
fmsub/fmadd.

Phabricator Review: http://reviews.llvm.org/D7299
Patch by Lawrence Hu <lawrence@codeaurora.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230241 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Analysis/TargetTransformInfoImpl.h
include/llvm/CodeGen/BasicTTIImpl.h
include/llvm/Target/TargetLowering.h
lib/Analysis/TargetTransformInfo.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/AArch64/lit.local.cfg [new file with mode: 0644]
test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll [new file with mode: 0644]