[llvm] [GlobalISel] Add constant-folding of FP binops to combiner. (PR #65230)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 03:26:59 PDT 2023


================
@@ -2645,6 +2645,14 @@ void CombinerHelper::replaceInstWithConstant(MachineInstr &MI, APInt C) {
   MI.eraseFromParent();
 }
 
+void CombinerHelper::replaceInstWithFConstant(MachineInstr &MI, ConstantFP *CFP) {
+  assert(MI.getNumDefs() == 1 && "Expected only one def?");
+  APFloat C = CFP->getValueAPF();
----------------
arsenm wrote:

Don't really need this temporary copy 

https://github.com/llvm/llvm-project/pull/65230


More information about the llvm-commits mailing list