[llvm] [X86] Don't rely on global -fp-contract=fast on X86 CodeGen tests (PR #158026)

Mikołaj Piróg via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 03:35:30 PDT 2025


================
@@ -10,10 +10,10 @@ define float @sqrt_ieee(float %f) #0 {
   ; CHECK-NEXT: {{  $}}
   ; CHECK-NEXT:   [[COPY:%[0-9]+]]:fr32 = COPY $xmm0
   ; CHECK-NEXT:   [[DEF:%[0-9]+]]:fr32 = IMPLICIT_DEF
-  ; CHECK-NEXT:   [[VSQRTSSr:%[0-9]+]]:fr32 = nofpexcept VSQRTSSr killed [[DEF]], [[COPY]], implicit $mxcsr
+  ; CHECK-NEXT:   [[VSQRTSSr:%[0-9]+]]:fr32 = contract nofpexcept VSQRTSSr killed [[DEF]], [[COPY]], implicit $mxcsr
   ; CHECK-NEXT:   $xmm0 = COPY [[VSQRTSSr]]
   ; CHECK-NEXT:   RET 0, $xmm0
-  %call = tail call float @llvm.sqrt.f32(float %f)
+  %call = tail call contract float @llvm.sqrt.f32(float %f)
----------------
mikolaj-pirog wrote:

I would say it's correct, the new `contract` lines appear because now the `sqrt` function has a `contract` and when the `sqrt` is expanded the instruction inherit its `contract` line. 

In essence previously everything had `contract` through the CLI argument, now everything has contract through `contract` keyword explicitly 

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


More information about the llvm-commits mailing list