[PATCH] Refactor and enhance FMA combine

Olivier Sallenave ohsallen at us.ibm.com
Thu Apr 2 12:41:49 PDT 2015


Hi Mehdi,

> I’d rather see the duplicated code (the one made obsolete by a correct canonicalization) removed from your patch (i.e. do not build technical debt), and a separate commits that implement the canonicalization part.


Makes perfect sense, thanks for your feedback. I was able to do the canonicalization you suggest by adding the following transforms:

(fsub (fneg A), B) -> (fneg (fadd A, B))
(fpext (fneg x)) -> (fneg (fpext x))

The problem is that I think those should be enabled only with -enable-unsafe-fp-math. So the two FMA combines that can be removed because of the canonicalization now only happen with -enable-unsafe-fp-math, whereas they used to work with -fp-contract=fast as well... Not sure what to do here.

Olivier


http://reviews.llvm.org/D8050

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list