[llvm] [X86][BF16] Do not combine FP_TRUNC + FP_EXTEND if they come from user (PR #91420)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 08:30:55 PDT 2024


================
@@ -56732,6 +56732,7 @@ static SDValue combineFP16_TO_FP(SDNode *N, SelectionDAG &DAG,
 }
 
 static SDValue combineFP_EXTEND(SDNode *N, SelectionDAG &DAG,
+                                TargetLowering::DAGCombinerInfo &DCI,
----------------
krzysz00 wrote:

I haven't read SDAG too closely either, but is this more viable than a rule in the legalizer that cancels out ROUND/EXTEND pairs that are introduced there?

... come to think of it, given the discussion under the previous patch about extended precision in intermediate computations being legal everywhere, this could be a general rule that all the implicit intermediate roundings that come from float promotion can be collapsed away? Since this seems applicable to, say, `half` as well.

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


More information about the llvm-commits mailing list