diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-09-26 21:36:10 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-09-26 21:36:10 +0000 |
commit | 47d3ee559a4bbac97db38c84e9c89e56eedc6fb9 (patch) | |
tree | 0046dbb752681da6c215e1c5f73b251b39b1700d | |
parent | de412c391b25f6b397c354a4e73653fec6d27587 (diff) | |
download | external_llvm-47d3ee559a4bbac97db38c84e9c89e56eedc6fb9.zip external_llvm-47d3ee559a4bbac97db38c84e9c89e56eedc6fb9.tar.gz external_llvm-47d3ee559a4bbac97db38c84e9c89e56eedc6fb9.tar.bz2 |
Convert more tests to new atomic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140567 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/Thumb/barrier.ll | 14 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-bcc.ll | 22 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-branch.ll | 18 |
3 files changed, 19 insertions, 35 deletions
diff --git a/test/CodeGen/Thumb/barrier.ll b/test/CodeGen/Thumb/barrier.ll index d39b50f..50d138f 100644 --- a/test/CodeGen/Thumb/barrier.ll +++ b/test/CodeGen/Thumb/barrier.ll @@ -2,24 +2,12 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=-db | FileCheck %s -check-prefix=V6 ; RUN: llc < %s -march=thumb -mcpu=cortex-m0 | FileCheck %s -check-prefix=V6M -declare void @llvm.memory.barrier(i1 , i1 , i1 , i1 , i1) - define void @t1() { ; V6: t1: ; V6: blx {{_*}}sync_synchronize ; V6M: t1: -; V6M: dmb st - call void @llvm.memory.barrier(i1 false, i1 false, i1 false, i1 true, i1 true) - ret void -} - -define void @t2() { -; V6: t2: -; V6: blx {{_*}}sync_synchronize - -; V6M: t2: ; V6M: dmb ish - call void @llvm.memory.barrier(i1 true, i1 false, i1 false, i1 true, i1 false) + fence seq_cst ret void } diff --git a/test/CodeGen/Thumb2/thumb2-bcc.ll b/test/CodeGen/Thumb2/thumb2-bcc.ll index 0f76054..4a2d600 100644 --- a/test/CodeGen/Thumb2/thumb2-bcc.ll +++ b/test/CodeGen/Thumb2/thumb2-bcc.ll @@ -6,20 +6,18 @@ define i32 @t1(i32 %a, i32 %b, i32 %c) { ; CHECK: t1: ; CHECK: cbz - %tmp2 = icmp eq i32 %a, 0 - br i1 %tmp2, label %cond_false, label %cond_true + %tmp2 = icmp eq i32 %a, 0 + br i1 %tmp2, label %cond_false, label %cond_true cond_true: - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) - %tmp5 = add i32 %b, 1 - %tmp6 = and i32 %tmp5, %c - ret i32 %tmp6 + fence seq_cst + %tmp5 = add i32 %b, 1 + %tmp6 = and i32 %tmp5, %c + ret i32 %tmp6 cond_false: - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) - %tmp7 = add i32 %b, -1 - %tmp8 = xor i32 %tmp7, %c - ret i32 %tmp8 + fence seq_cst + %tmp7 = add i32 %b, -1 + %tmp8 = xor i32 %tmp7, %c + ret i32 %tmp8 } - -declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind diff --git a/test/CodeGen/Thumb2/thumb2-branch.ll b/test/CodeGen/Thumb2/thumb2-branch.ll index 4d9eda0..27d8e8f 100644 --- a/test/CodeGen/Thumb2/thumb2-branch.ll +++ b/test/CodeGen/Thumb2/thumb2-branch.ll @@ -11,12 +11,12 @@ entry: br i1 %tmp, label %cond_true, label %return cond_true: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst store i32 0, i32* %v ret i32 0 return: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst ret i32 1 } @@ -28,12 +28,12 @@ entry: br i1 %tmp, label %cond_true, label %return cond_true: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst store i32 0, i32* %v ret i32 0 return: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst ret i32 1 } @@ -45,12 +45,12 @@ entry: br i1 %tmp, label %cond_true, label %return cond_true: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst store i32 0, i32* %v ret i32 0 return: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst ret i32 1 } @@ -62,13 +62,11 @@ entry: br i1 %tmp, label %return, label %cond_true cond_true: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst store i32 0, i32* %v ret i32 0 return: ; preds = %entry - call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false) + fence seq_cst ret i32 1 } - -declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind |