[PATCH] D43090: GlobalISel: IRTranslate llvm.fmuladd.* intrinsic

Volkan Keles via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 12:51:10 PST 2018


volkan added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:765
+        TLI.isFMAFasterThanFMulAndFAdd(TLI.getValueType(*DL, CI.getType()))) {
+      MIRBuilder.buildInstr(TargetOpcode::G_FMA, Dst, Op0, Op1, Op2);
+    } else {
----------------
aditya_nandakumar wrote:
> qcolombet wrote:
> > So far we stayed away of "optimizations" in the IRTranslator.
> > I wonder if this part of the lowering should be part of a combiner instead.
> > 
> > In particular, the language reference says:
> > Fusion is not guaranteed, even if the target platform supports it.
> > 
> > What do you think?
> That's also what I said when I spoke with him in person. Unfortunately, currently there's no other place to put it (to avoid duplicating across all targets).
Yes, fusion is not guaranteed but I think we still need to translate this to either one of the options. If IRTranslator doesn't do that, every target would have to handle this in somewhere else as the combiner is optional.


https://reviews.llvm.org/D43090





More information about the llvm-commits mailing list