[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();
+ Builder.setInstr(MI);
----------------
arsenm wrote:
We should really just fix the combiner to always set the insert point before the apply
https://github.com/llvm/llvm-project/pull/65230
More information about the llvm-commits
mailing list