[llvm] SystemZ: Stop casting fp typed atomic loads in the IR (PR #90768)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 08:25:07 PDT 2024
================
@@ -1,20 +1,27 @@
-; Test long double atomic loads. These are emitted by the Clang FE as i128
-; loads with a bitcast, and this test case gets converted into that form as
-; well by the AtomicExpand pass.
+; Test long double atomic loads.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck -check-prefixes=CHECK,BASE %s
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck -check-prefixes=CHECK,Z13 %s
-
; TODO: Is it worth testing softfp with vector?
; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=+soft-float | FileCheck -check-prefixes=SOFTFP %s
+; FIXME: Without vector support, v2i64 should be legal and we should
+; introduce a simple bitcast instead of the stack temporary store and
+; reload
define void @f1(ptr %ret, ptr %src) {
; CHECK-LABEL: f1:
; CHECK: # %bb.0:
-; CHECK-NEXT: lpq %r0, 0(%r3)
-; CHECK-NEXT: stg %r1, 8(%r2)
-; CHECK-NEXT: stg %r0, 0(%r2)
-; CHECK-NEXT: br %r14
+; Z13-NEXT: lpq %r0, 0(%r3)
+; Z13-NEXT: stg %r1, 8(%r2)
+; Z13-NEXT: stg %r0, 0(%r2)
+; Z13-NEXT: br %r14
+
+; BASE: lpq %r0, 0(%r3)
+; BASE-NEXT: ldgr %f0, %r0
+; BASE-NEXT: ldgr %f2, %r1
+; BASE-NEXT: std %f0, 0(%r2)
+; BASE-NEXT: std %f2, 8(%r2)
----------------
uweigand wrote:
Would be nice to short-circuit the LDGR/STD to just an STG here. We actually do this already for spills in `foldMemoryOperandImpl`, but not for regular stores. But this can be done separately.
https://github.com/llvm/llvm-project/pull/90768
More information about the llvm-commits
mailing list