[flang-commits] [flang] [flang][Lower] Add alternative real expression lowering (PR #207371)

Ivan R. Ivanov via flang-commits flang-commits at lists.llvm.org
Fri Jul 3 07:42:53 PDT 2026


ivanradanov wrote:

Am I understanding correctly that we do the rewrite in the front end here?

I was wondering whether leaving the optimization to LLVM may produce better results as it is closer to the hardware and the heuristics may be more mature.  We could achieve that by finding the specific operations in the RHS that can be reassociated and then tagging only those with a `reassoc` in the fast math attributes (https://mlir.llvm.org/docs/Dialects/ArithOps/#attributes). That should eventually lower to the rewrite fast math flags in LLVM (https://llvm.org/docs/LangRef.html#rewrite-based-flags) if everything is  hooked up properly.

However, I may be missing something and it's not possible to propagate all the information that is available in the frontend.


https://github.com/llvm/llvm-project/pull/207371


More information about the flang-commits mailing list