[llvm] [GlobalISel] Improve bf16 converts with fast-math flags. (PR #200741)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 00:49:11 PDT 2026


davemgreen wrote:

> Am I missing something here or could widenScalar/Dst just pull the flags from the passed in MI?

For FP I believe it is OK, but we probably don't want to do the same for integer ops.

> is there any harm in unconditionally forwarding flags here?

Depends which way you mean by "unconditionally forwarding". I don't think we would want to forward all flags unconditionally for integer ops, but for FP I think it would be OK as most of the flags do not apply (like FrameSetup and BundledPred), or are integer flags (like NoUWrap and Disjoint).

I've switched to new widenScalarDstUsingFPTrunc and widenScalarSrcUsingFPExt functions that clear all but the FMF's to be safer though, now that we can do it in one place and grab them straight from MI.

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


More information about the llvm-commits mailing list