[PATCH] D135264: [MachineCombiner][RISCV] Enable MachineCombiner for RISCV

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 10:36:01 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:1210
+
+  if (Options.UnsafeFPMath && getFPPatterns(Root, Patterns))
+    return true;
----------------
asi-sc wrote:
> craig.topper wrote:
> > Why not use fast math flags?
> I changed current implementation to use fast math flags, but I have a question related to that.
> Clang distributes fast math flags to instructions if `-ffast-math` is passed, whereas llc does not. So, theoretically we can have `UnsafeFPMath` option enabled and don't have fast math flags on instructions. What do you think, should we combine instructions in this case?
Here's the patch where X86 removed the UnsafeFPMath check https://reviews.llvm.org/D74851


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135264



More information about the llvm-commits mailing list