[PATCH] D132439: [DAGCombiner][NFC] Use isa instead of dyn_cast in visitFP_ROUND.

WangLian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 04:12:55 PDT 2022


Jimerlife marked an inline comment as done.
Jimerlife added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15859
   // fold (fp_round c1fp) -> c1fp
-  if (N0CFP)
+  if (isa<ConstantFPSDNode>(N0))
     return DAG.getNode(ISD::FP_ROUND, SDLoc(N), VT, N0, N1);
----------------
RKSimon wrote:
> Might this be better as just a constant fold attempt?
> ```
> if (SDValue C = DAG.FoldConstantArithmetic(ISD::FP_ROUND, SDLoc(N), VT, {N0, N1}))
>   return C;
> ```
Thank you. Good suggestion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132439



More information about the llvm-commits mailing list