[PATCH] D105525: [GISel] Add fpext/fptrunc combines

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 17:54:33 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2490
+  // floating point types, but will have altered precision when folded to
+  // float. We will only allow this fold for Unsafe and 8bit cases.
+  Register SrcInputReg = SrcMI->getOperand(1).getReg();
----------------
foad wrote:
> Is there a precedent for using "UnsafeFPMath" to enable this particular unsafe combine?
This looks really similar to the `isKnownExactCastIntToFP` case in `InstCombinerImpl::visitFPExt`.

Taking a peek in `isKnownExactCastIntToFP` doesn't have any mention of unsafe math. I couldn't find anything in SelectionDAG either (but maybe I missed something?)

(The checks in `isKnownExactCastIntToFP` seem to do a lot of work actually; I wonder if it would make sense to do something similar here? I guess that could be a follow-up patch.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105525/new/

https://reviews.llvm.org/D105525



More information about the llvm-commits mailing list