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

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 04:28:06 PDT 2025


=?utf-8?q?Mikołaj_Piróg?= <mikolajpirog at gmail.com>,Pirog, Mikolaj
 Maciej <mikolaj.maciej.pirog at intel.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/158026 at github.com>


================
@@ -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)
----------------
e-kud wrote:

> In essence previously everything had contract through the CLI argument,

It isn't so. The cli flag wasn't applied to MIR instruction in case of `sqrt_ieee` but was applied in case of `rsqrt_ieee` this is why I'm asking whether it is desired as it's not clear why we start adding contract here.

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


More information about the llvm-commits mailing list