[PATCH] D86393: [GISel] Add combines for unary FP instrs with constant operand

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 16:51:44 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1486-1489
+  if (DstTy == S16)
+    V.convert(APFloat::IEEEhalf(), APFloat::rmNearestTiesToEven, &Unused);
+  else if (DstTy == S32)
+    V.convert(APFloat::IEEEsingle(), APFloat::rmNearestTiesToEven, &Unused);
----------------
We should probably have a getFltSemanticForLLT utility somewhere for this


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1506
+  assert(Cst.hasValue() && "Optional is unexpectedly empty!");
+  Builder.setInstr(MI);
+  MachineFunction &MF = Builder.getMF();
----------------
setInstrAndDebugLoc?


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

https://reviews.llvm.org/D86393



More information about the llvm-commits mailing list