[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
Fri Aug 28 11:16:33 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);
----------------
mkitzan wrote:
> arsenm wrote:
> > We should probably have a getFltSemanticForLLT utility somewhere for this
> Doesn't appear to be one for `LLT`. I suspect because unlike `Type`, with its discrete number of `TypeID`s, `LLT` is very open ended.
Yes, that's why there should be one. An FP LLT isn't any arbitrary number of bits, there's still only the handful of valid FP type combinations. We're probably going to have to add something to track f16 vs. bf16, but for now it's still a switch over a handful of valid FP sizes


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

https://reviews.llvm.org/D86393



More information about the llvm-commits mailing list