[PATCH] D132435: [RISCV] Fold fp_to_int(ftrunc (X)) -> fp_to_int(X) for vector.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 17:54:24 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8862
+  if (IsVector)
+    // (fp_to_int (ftrunc V))     -> fp_to_int (V)
+    // Keep fp_to_int for RVV, let it do custom lowerring.
----------------
I'm not sure we should do this. There is a slight semantic difference. If this was legal to replace `(fp_to_int (ftrunc V))` with `fp_to_int (V)` we'd just do that in generic DAGCombine or InstCombine for all targets.

I need to think through exactly what bad thing can happen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132435



More information about the llvm-commits mailing list