[llvm] [SDISel][Combine] Constant fold FP16_TO_FP (PR #94790)
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 13:12:16 PDT 2024
================
@@ -26586,7 +26586,12 @@ SDValue DAGCombiner::visitFP16_TO_FP(SDNode *N) {
}
}
- return SDValue();
+ // Sometimes constants manage to survive very late in the pipeline, e.g.,
+ // because they are wrapped inside the <1 x f16> type. Try one last time to
+ // get rid of them.
+ SDValue Folded = DAG.FoldConstantArithmetic(
+ N->getOpcode(), SDLoc(N), N->getValueType(0), ArrayRef<SDValue>(&N0, 1));
----------------
qcolombet wrote:
Ah, let me try that, I knew there must be an easier way to do that :).
https://github.com/llvm/llvm-project/pull/94790
More information about the llvm-commits
mailing list