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

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 13:03:06 PDT 2021


aditya_nandakumar 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>">;
----------------
pnappa wrote:
> foad wrote:
> > 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.
> I don't know the answer to this, any one else want to chime in?
I think we've tried constant folding size changing ops (such as ZEXT) in the builder and it has the potential to cause infinite loops in the legalizer algorithm.
In general, since the builder doesn't care about the legality of ops it's folding and producing, we should be a bit careful on what transformations we introduce as part of building instructions.
 


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

https://reviews.llvm.org/D105525



More information about the llvm-commits mailing list