[PATCH] D68739: [GISel] Allow ConstantFoldBinOp to consider G_FCONSTANT binary representation for combines

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 17:46:04 PDT 2019


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:321-324
+  const ConstantFP *FPVal = getConstantFPVRegVal(VReg, MRI);
+  if (FPVal)
+    return FPVal->getValueAPF().bitcastToAPInt();
+  Optional<int64_t> IntVal = getConstantVRegVal(VReg, MRI);
----------------
I kind of don't like potentially repeating the search through copy/extensions twice. Can you maybe add some kind of parameter to getConstantVRegValWithLookThrough, so it handles both?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D68739





More information about the llvm-commits mailing list