[PATCH] DAGCombiner: don't duplicate (fmul x, c) when folding fneg if fneg is free

escha escha at apple.com
Fri Jun 5 11:18:14 PDT 2015


I'd totally agree with you, but I felt this was less invasive and risky for the moment.

Mainly, I noticed that some other folds (e.g. FMA combining) might not have been designed with an unfolded fneg in mind, so this change made independently (without looking at other folds and verifying things are okay) might worsen code on other platforms. Since I hadn't done that sort of performance verification for anything other than a GPU with neg-mods on inputs, I'm not that confident with that aggressive a change.

... plus, I think the isNegatableForFree code path already does something like this? So I kinda assumed that this fold existed for a reason and didn't want to muck with it too much.

But like, if you want to investigate making it entirely conditional on hasOneUse, that sounds totally okay!


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10277

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






More information about the llvm-commits mailing list