From 47d3ee559a4bbac97db38c84e9c89e56eedc6fb9 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 26 Sep 2011 21:36:10 +0000 Subject: [PATCH] Convert more tests to new atomic instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140567 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/Thumb/barrier.ll | 14 +------------- test/CodeGen/Thumb2/thumb2-bcc.ll | 22 ++++++++++------------ 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 d39b50f0a9d..50d138fe44d 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 0f7605402cf..4a2d6000bbc 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 4d9eda062f9..27d8e8fb408 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