-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Lowering of load atomic float via cast
X86 backend does not lower load atomic float, so we can cast to an integer before lowering.
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
%ret = load atomic float, ptr %src acquire, align 4 | ||
ret float %ret | ||
} | ||
|