[clang] [CIR] Record -ffp-contract=fast as a per-op contract flag (PR #226334)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 15:55:01 PDT 2026


================
@@ -51,10 +51,20 @@ CIRGenFunction::CIRGenFunction(CIRGenModule &cgm, CIRGenBuilderTy &builder,
   ehStack.setCGF(this);
   shouldEmitLifetimeMarkers = CodeGenUtils::shouldEmitLifetimeMarkers(
       cgm.getCodeGenOpts(), getContext().getLangOpts());
+  setFastMathFlags(curFPFeatures);
 }
 
 CIRGenFunction::~CIRGenFunction() {}
 
+void CIRGenFunction::setFastMathFlags(FPOptions fpFeatures) {
+  // TODO(cir): set the remaining fast-math flags.
+  assert(!cir::MissingFeatures::fastMathFlags());
+  cir::FastMathFlags flags = cir::FastMathFlags::none;
+  if (fpFeatures.allowFPContractAcrossStatement())
----------------
andykaylor wrote:

No worries. I appreciate that you've implemented it now.

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


More information about the cfe-commits mailing list