[PATCH] D150189: GlobalISel: Refactor unary FP op constant folding

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 03:07:02 PDT 2023


Pierre-vh added a comment.

LGTM, just a small style nit



================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1294
+                    const APFloat &Val) {
+  APFloat V(Val);
+  switch (MI.getOpcode()) {
----------------
small nit: not a fan of having V/Val in the same function, the names get confusing - maybe use something like `Ret` instead? Or rename the `Val` parameter to something more descriptive.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1307
+  case TargetOpcode::G_FPTRUNC: {
+    bool Unused;
+    LLT DstTy = MRI.getType(MI.getOperand(0).getReg());
----------------
If I understand correctly this is a NFC, G_FPTRUNC was handled anyway by the `V.convert` call below, but now it's explicit?


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

https://reviews.llvm.org/D150189



More information about the llvm-commits mailing list