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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 03:35:39 PDT 2021


foad added inline comments.


================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:346
 
 // Fold fp_op(cst) to the constant result of the floating point operation.
 def constant_fp_op_matchinfo: GIDefMatchData<"Optional<APFloat>">;
----------------
I didn't know we had these as combines. Do we really want this, instead of constant-folding them in CSEMIRBuilder? See D99036 and D104528 for some steps in that direction.


================
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();
----------------
Is there a precedent for using "UnsafeFPMath" to enable this particular unsafe combine?


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

https://reviews.llvm.org/D105525



More information about the llvm-commits mailing list