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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 03:26:33 PDT 2022


RKSimon 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);
----------------
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;
```


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