[llvm] [X86] Lowering of load atomic float via cast (PR #117189)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 16:18:24 PST 2024


================
@@ -0,0 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s --mtriple=x86_64 --passes=atomic-expand -S -o - | FileCheck %s
+
+define float @load_atomic_float() {
+; CHECK-LABEL: define float @load_atomic_float() {
+; CHECK-NEXT:    [[SRC:%.*]] = alloca float, align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = load atomic i32, ptr [[SRC]] acquire, align 4
+; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i32 [[TMP1]] to float
+; CHECK-NEXT:    ret float [[TMP2]]
+;
+  %src = alloca float
----------------
arsenm wrote:

Use a pointer argument instead of an alloca 

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


More information about the llvm-commits mailing list