[PATCH] D112428: [DAG] Create fptoui.sat from clamped fptosi

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 11:55:55 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4857
 
   APInt MinC = MinCOp->getAPIntValue();
   APInt MaxC = MaxCOp->getAPIntValue();
----------------
Can these be `const APInt &`? They don't seem to be modified.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.h:1085
+    bool shouldConvertFpToSat(unsigned Op, EVT FPVT,
+                                                  EVT VT) const override {
+      // Converting to sat variants holds little benefit on X86 as we will just
----------------
Formatting looks wrong here


================
Comment at: llvm/test/CodeGen/RISCV/fpclamptosat.ll:187
+; RV32IF-NEXT:  # %bb.1: # %entry
+; RV32IF-NEXT:    slti a2, a1, 0
+; RV32IF-NEXT:    beqz a2, .LBB2_3
----------------
Something weird is happening here. We should be able to fold the slti and beqz together. I'll investigate.


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

https://reviews.llvm.org/D112428



More information about the llvm-commits mailing list