[PATCH] D116771: [RISCV] Add DAG combine to fold (fp_to_int (ffloor X)) -> (fcvt X, rdn)

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 02:38:18 PST 2022


asb accepted this revision.
asb added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:7058
+
+  // Don't do this for f16 with Zfhmin and not Zfh.
+  if (Src.getValueType() == MVT::f16 && !Subtarget.hasStdExtZfh())
----------------
craig.topper wrote:
> asb wrote:
> > Is it possible to add some test coverage for this?
> No because we don't have f16 as a legal type with Zfhmin yet. I was coding defensively assuming that would change in the future and I didn't want someone to have to audit for it.
Thanks for clarifying - I'd forgotten f16 wasn't yet legal for zfhmin. As you suggest coding defensively is obviously the right thing to do even if we can't test it currently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116771



More information about the llvm-commits mailing list