1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/CodeGen/PowerPC/ppc440-msync.ll
Hal Finkel 2093a3cb26 [PowerPC] Modern Book-E cores support sync
Older Book-E cores, such as the PPC 440, support only msync (which has the same
encoding as sync 0), but not any of the other sync forms. Newer Book-E cores,
however, do support sync, and for performance reasons we should allow the use
of the more-general form.

This refactors msync use into its own feature group so that it applies by
default only to older Book-E cores (of the relevant cores, we only have
definitions for the PPC440/450 currently).

llvm-svn: 218923
2014-10-02 22:34:22 +00:00

29 lines
525 B
LLVM

; RUN: llc < %s -march=ppc32 | FileCheck %s
; RUN: llc < %s -march=ppc64 -mcpu=a2 | FileCheck %s
; RUN: llc < %s -march=ppc32 -mcpu=440 | FileCheck %s -check-prefix=BE-CHK
define i32 @has_a_fence(i32 %a, i32 %b) nounwind {
entry:
fence acquire
%cond = icmp eq i32 %a, %b
br i1 %cond, label %IfEqual, label %IfUnequal
IfEqual:
fence release
; CHECK: sync
; CHECK-NOT: msync
; BE-CHK: msync
br label %end
IfUnequal:
fence release
; CHECK: sync
; CHECK-NOT: msync
; BE-CHK: msync
ret i32 0
end:
ret i32 1
}