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

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 15:29:31 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2466
+  unsigned SrcOpc = SrcMI->getOpcode();
+  if (SrcOpc == TargetOpcode::G_SITOFP || SrcOpc == TargetOpcode::G_UITOFP) {
+    MatchInfo = std::make_tuple(SrcMI->getOperand(1).getReg(), SrcOpc);
----------------
It's unfortunate that there's nothing in MIPatternMatch for G_SITOFP and G_UITOFP right now, because it looks like this would work nicely with mi_match.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2491
+  unsigned SrcOpc = SrcMI->getOpcode();
+  if ((SrcOpc == TargetOpcode::G_SITOFP || SrcOpc == TargetOpcode::G_UITOFP)) {
+    // 8-bit integers are fully representable in supported floating point types.
----------------
May be worth reducing indentation here for the sake of slight readability gains.

Also there are some extra braces here which aren't needed.


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

https://reviews.llvm.org/D105525



More information about the llvm-commits mailing list