diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2017-09-28 16:22:54 +0000 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2017-09-28 16:22:54 +0000 |
| commit | 0f1de04979af245e93598ab197251924b300485f (patch) | |
| tree | 93e70dfb01c78868c73e867f32631df7c3735c8c /llvm/test/CodeGen/SystemZ/cmpxchg-04.ll | |
| parent | b688d131f0a3f062d3d4c7c936a11c353547d866 (diff) | |
| download | bcm5719-llvm-0f1de04979af245e93598ab197251924b300485f.tar.gz bcm5719-llvm-0f1de04979af245e93598ab197251924b300485f.zip | |
[SystemZ] Custom-expand ATOMIC_CMP_AND_SWAP_WITH_SUCCESS
The SystemZ compare-and-swap instructions already provide the "success"
indication via a condition-code value, so the default expansion of those
operations generates an unnecessary extra comparsion.
llvm-svn: 314428
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/cmpxchg-04.ll')
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/cmpxchg-04.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/cmpxchg-04.ll b/llvm/test/CodeGen/SystemZ/cmpxchg-04.ll index b0560876b87..f461315b999 100644 --- a/llvm/test/CodeGen/SystemZ/cmpxchg-04.ll +++ b/llvm/test/CodeGen/SystemZ/cmpxchg-04.ll @@ -105,3 +105,18 @@ define i64 @f9(i64 %cmp, i64 *%ptr) { %val = extractvalue { i64, i1 } %pairval, 0 ret i64 %val } + +; Check generating the comparison result. +; CHECK-LABEL: f10 +; CHECK: csg %r2, %r3, 0(%r4) +; CHECK-NEXT: ipm %r2 +; CHECK-NEXT: afi %r2, -268435456 +; CHECK-NEXT: srl %r2, 31 +; CHECK: br %r14 +define i32 @f10(i64 %cmp, i64 %swap, i64 *%src) { + %pairval = cmpxchg i64 *%src, i64 %cmp, i64 %swap seq_cst seq_cst + %val = extractvalue { i64, i1 } %pairval, 1 + %res = zext i1 %val to i32 + ret i32 %res +} + |

