[InstCombine] fold fdiv with exp/exp2 divisor (PR49147)
authorSanjay Patel <spatel@rotateright.com>
Sat, 20 Feb 2021 14:02:39 +0000 (09:02 -0500)
committerSanjay Patel <spatel@rotateright.com>
Sat, 20 Feb 2021 21:02:58 +0000 (16:02 -0500)
commite772618f1ee2fe7709a17e6d850623a97e23a8dc
tree6f6005a726ba8c585e33d76344b732fedf0d5e7a
parentfbca27bf2967aff047bb6c2842e0de344b67cf7b
[InstCombine] fold fdiv with exp/exp2 divisor (PR49147)

Follow-up to:
D96648 / b40fde062
...for the special-case base calls.

From the earlier commit:
This is unusual in the general (non-reciprocal) case because we need
an extra instruction, but that should be better for general FP
reassociation and codegen. We conservatively check for "arcp" FMF
here as we do with existing fdiv folds, but it is not strictly
necessary to have that.
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/fdiv.ll