[llvm] r235663 - [PowerPC] Use sync inst alias when printing
Hal Finkel
hfinkel at anl.gov
Thu Apr 23 16:05:09 PDT 2015
Author: hfinkel
Date: Thu Apr 23 18:05:08 2015
New Revision: 235663
URL: http://llvm.org/viewvc/llvm-project?rev=235663&view=rev
Log:
[PowerPC] Use sync inst alias when printing
So long as the choice between printing msync and sync is not ambiguous, we can
print 'sync 0' and just 'sync'.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
llvm/trunk/test/CodeGen/PowerPC/atomics-fences.ll
llvm/trunk/test/CodeGen/PowerPC/atomics-indexed.ll
llvm/trunk/test/CodeGen/PowerPC/atomics.ll
llvm/trunk/test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookII.s
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Thu Apr 23 18:05:08 2015
@@ -3484,7 +3484,7 @@ class PPCAsmPseudo<string asm, dag iops>
def : InstAlias<"sc", (SC 0)>;
def : InstAlias<"sync", (SYNC 0)>, Requires<[HasSYNC]>;
-def : InstAlias<"msync", (SYNC 0)>, Requires<[HasSYNC]>;
+def : InstAlias<"msync", (SYNC 0), 0>, Requires<[HasSYNC]>;
def : InstAlias<"lwsync", (SYNC 1)>, Requires<[HasSYNC]>;
def : InstAlias<"ptesync", (SYNC 2)>, Requires<[HasSYNC]>;
Modified: llvm/trunk/test/CodeGen/PowerPC/atomics-fences.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomics-fences.ll?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/atomics-fences.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/atomics-fences.ll Thu Apr 23 18:05:08 2015
@@ -21,8 +21,7 @@ define void @fence_release() {
}
define void @fence_seq_cst() {
; CHECK-LABEL: fence_seq_cst
-; CHECK: sync 0
-; PPC440-NOT: sync 0
+; CHECK: sync
; PPC440: msync
fence seq_cst
ret void
Modified: llvm/trunk/test/CodeGen/PowerPC/atomics-indexed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomics-indexed.ll?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/atomics-indexed.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/atomics-indexed.ll Thu Apr 23 18:05:08 2015
@@ -9,7 +9,7 @@
; Indexed version of loads
define i8 @load_x_i8_seq_cst([100000 x i8]* %mem) {
; CHECK-LABEL: load_x_i8_seq_cst
-; CHECK: sync 0
+; CHECK: sync
; CHECK: lbzx
; CHECK: lwsync
%ptr = getelementptr inbounds [100000 x i8], [100000 x i8]* %mem, i64 0, i64 90000
@@ -46,7 +46,7 @@ define i64 @load_x_i64_unordered([100000
; Indexed version of stores
define void @store_x_i8_seq_cst([100000 x i8]* %mem) {
; CHECK-LABEL: store_x_i8_seq_cst
-; CHECK: sync 0
+; CHECK: sync
; CHECK: stbx
%ptr = getelementptr inbounds [100000 x i8], [100000 x i8]* %mem, i64 0, i64 90000
store atomic i8 42, i8* %ptr seq_cst, align 1
@@ -70,8 +70,7 @@ define void @store_x_i32_monotonic([1000
}
define void @store_x_i64_unordered([100000 x i64]* %mem) {
; CHECK-LABEL: store_x_i64_unordered
-; CHECK-NOT: sync 0
-; CHECK-NOT: lwsync
+; CHECK-NOT: sync
; PPC32: __sync_
; PPC64-NOT: __sync_
; PPC64: stdx
Modified: llvm/trunk/test/CodeGen/PowerPC/atomics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomics.ll?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/atomics.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/atomics.ll Thu Apr 23 18:05:08 2015
@@ -32,7 +32,7 @@ define i32 @load_i32_acquire(i32* %mem)
}
define i64 @load_i64_seq_cst(i64* %mem) {
; CHECK-LABEL: load_i64_seq_cst
-; CHECK: sync 0
+; CHECK: sync
; PPC32: __sync_
; PPC64-NOT: __sync_
; PPC64: ld
@@ -65,7 +65,7 @@ define void @store_i32_release(i32* %mem
}
define void @store_i64_seq_cst(i64* %mem) {
; CHECK-LABEL: store_i64_seq_cst
-; CHECK: sync 0
+; CHECK: sync
; PPC32: __sync_
; PPC64-NOT: __sync_
; PPC64: std
@@ -76,7 +76,7 @@ define void @store_i64_seq_cst(i64* %mem
; Atomic CmpXchg
define i8 @cas_strong_i8_sc_sc(i8* %mem) {
; CHECK-LABEL: cas_strong_i8_sc_sc
-; CHECK: sync 0
+; CHECK: sync
%val = cmpxchg i8* %mem, i8 0, i8 1 seq_cst seq_cst
; CHECK: lwsync
%loaded = extractvalue { i8, i1} %val, 0
@@ -116,7 +116,7 @@ define i8 @add_i8_monotonic(i8* %mem, i8
}
define i16 @xor_i16_seq_cst(i16* %mem, i16 %operand) {
; CHECK-LABEL: xor_i16_seq_cst
-; CHECK: sync 0
+; CHECK: sync
%val = atomicrmw xor i16* %mem, i16 %operand seq_cst
; CHECK: lwsync
ret i16 %val
Modified: llvm/trunk/test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt (original)
+++ llvm/trunk/test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt Thu Apr 23 18:05:08 2015
@@ -72,10 +72,10 @@
# CHECK: ldarx 2, 3, 4, 1
0x7c 0x43 0x20 0xa9
-# CHECK: sync 0
+# CHECK: sync
0x7c 0x00 0x04 0xac
-# CHECK: sync 0
+# CHECK: sync
0x7c 0x00 0x04 0xac
# CHECK: lwsync
Modified: llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookII.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookII.s?rev=235663&r1=235662&r2=235663&view=diff
==============================================================================
--- llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookII.s (original)
+++ llvm/trunk/test/MC/PowerPC/ppc64-encoding-bookII.s Thu Apr 23 18:05:08 2015
@@ -131,11 +131,11 @@
# CHECK-LE: ldarx 2, 3, 4, 1 # encoding: [0xa9,0x20,0x43,0x7c]
ldarx 2, 3, 4, 1
-# CHECK-BE: sync 0 # encoding: [0x7c,0x00,0x04,0xac]
-# CHECK-LE: sync 0 # encoding: [0xac,0x04,0x00,0x7c]
+# CHECK-BE: sync # encoding: [0x7c,0x00,0x04,0xac]
+# CHECK-LE: sync # encoding: [0xac,0x04,0x00,0x7c]
sync
-# CHECK-BE: sync 0 # encoding: [0x7c,0x00,0x04,0xac]
-# CHECK-LE: sync 0 # encoding: [0xac,0x04,0x00,0x7c]
+# CHECK-BE: sync # encoding: [0x7c,0x00,0x04,0xac]
+# CHECK-LE: sync # encoding: [0xac,0x04,0x00,0x7c]
msync
# CHECK-BE: lwsync # encoding: [0x7c,0x20,0x04,0xac]
# CHECK-LE: lwsync # encoding: [0xac,0x04,0x20,0x7c]
More information about the llvm-commits
mailing list