IIUC, the conversion part is not part of atomic operations and fences should be put around converted atomic operations. This also fixes atomic load of floating point values which requires fence on PowerPC. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D127609
30 lines
901 B
LLVM
30 lines
901 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -opaque-pointers -mtriple=powerpc64le-unknown-unknown \
|
|
; RUN: < %s 2>&1 | FileCheck --check-prefix=CHECK-LE %s
|
|
; RUN: llc -opaque-pointers -mtriple=powerpc64-unknown-unknown \
|
|
; RUN: < %s 2>&1 | FileCheck %s
|
|
|
|
define double @foo(double* %dp) {
|
|
; CHECK-LE-LABEL: foo:
|
|
; CHECK-LE: # %bb.0: # %entry
|
|
; CHECK-LE-NEXT: ld 3, 0(3)
|
|
; CHECK-LE-NEXT: cmpd 7, 3, 3
|
|
; CHECK-LE-NEXT: mtfprd 1, 3
|
|
; CHECK-LE-NEXT: bne- 7, .+4
|
|
; CHECK-LE-NEXT: isync
|
|
; CHECK-LE-NEXT: blr
|
|
;
|
|
; CHECK-LABEL: foo:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: ld 3, 0(3)
|
|
; CHECK-NEXT: cmpd 7, 3, 3
|
|
; CHECK-NEXT: bne- 7, .+4
|
|
; CHECK-NEXT: isync
|
|
; CHECK-NEXT: std 3, -8(1)
|
|
; CHECK-NEXT: lfd 1, -8(1)
|
|
; CHECK-NEXT: blr
|
|
entry:
|
|
%0 = load atomic double, double* %dp acquire, align 8
|
|
ret double %0
|
|
}
|