DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor...
authorHao Liu <Hao.Liu@arm.com>
Fri, 21 Nov 2014 06:39:58 +0000 (06:39 +0000)
committerHao Liu <Hao.Liu@arm.com>
Fri, 21 Nov 2014 06:39:58 +0000 (06:39 +0000)
commit44e5d7a131d300ce6ba023551e3658e714db0a5a
tree6319cd5c7f7bb31e15ed85afdb7144051b53d7eb
parent61e88f44f9e32262df7d7465451f47fc8fc48472
DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor info FMULs by the reciprocal.
E.g., ( a / D; b / D ) -> ( recip = 1.0 / D; a * recip; b * recip)

A hook is added to allow the target to control whether it needs to do such combine.

Reviewed in http://reviews.llvm.org/D6334

llvm-svn: 222510
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/test/CodeGen/AArch64/fdiv-combine.ll [new file with mode: 0644]