Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: test/CodeGen/X86/cmpxchg-clobber-flags.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/CodeGen/X86/atomic16.ll ('k') | test/CodeGen/X86/fast-isel-gep.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/CodeGen/X86/cmpxchg-clobber-flags.ll
diff --git a/test/CodeGen/X86/cmpxchg-clobber-flags.ll b/test/CodeGen/X86/cmpxchg-clobber-flags.ll
index 3cb8b97de45ff2ef1789484dc74b0f0cb1b8db71..bcdb331aff774534311f42f59f135e1b04dd165d 100644
--- a/test/CodeGen/X86/cmpxchg-clobber-flags.ll
+++ b/test/CodeGen/X86/cmpxchg-clobber-flags.ll
@@ -1,19 +1,42 @@
-; RUN: llc -mtriple=x86_64-linux-gnu %s -o - | FileCheck %s
-; RUN: llc -mtriple=x86_64-linux-gnu -pre-RA-sched=fast %s -o - | FileCheck %s
+; RUN: llc -mtriple=i386-unknown-linux %s -o - | FileCheck %s
+; RUN: llc -mtriple=i386-unknown-linux -pre-RA-sched=fast %s -o - | FileCheck %s
+; RUN: llc -mtriple=x86_64-unknown-linux %s -o - | FileCheck %s
+; RUN: llc -mtriple=x86_64-unknown-linux -pre-RA-sched=fast %s -o - | FileCheck %s
+; RUN: llc -mtriple=i386-unknown-nacl %s -o - | FileCheck %s -check-prefix=NACL
+; RUN: llc -mtriple=i386-unknown-nacl -pre-RA-sched=fast %s -o - | FileCheck %s -check-prefix=NACL
+; RUN: llc -mtriple=x86_64-unknown-nacl %s -o - | FileCheck %s -check-prefix=NACL
+; RUN: llc -mtriple=x86_64-unknown-nacl -pre-RA-sched=fast %s -o - | FileCheck %s -check-prefix=NACL
declare i32 @bar()
define i64 @test_intervening_call(i64* %foo, i64 %bar, i64 %baz) {
; CHECK-LABEL: test_intervening_call:
; CHECK: cmpxchg
-; CHECK: pushfq
-; CHECK: popq [[FLAGS:%.*]]
+; CHECK: pushf[[LQ:[lq]]]
+; CHECK-NEXT: pop[[LQ]] [[FLAGS:%.*]]
-; CHECK: callq bar
+; CHECK-NEXT: call[[LQ]] bar
+
+; CHECK-NEXT: push[[LQ]] [[FLAGS]]
+; CHECK-NEXT: popf[[LQ]]
+; CHECK-NEXT: jne
+
+
+; NACL-LABEL: test_intervening_call:
+; NACL: cmpxchg
+; NACL: push[[LQ:[lq]]] [[AX:%.*]]
+; NACL-NEXT: lahf
+; NACL-NEXT: mov[[LQ]] [[AX]], [[FLAGS:%.*]]
+; NACL-NEXT: pop[[LQ]] [[AX]]
+
+; NACL-NEXT: call[[LQ]] bar
+
+; NACL-NEXT: push[[LQ]] [[AX]]
+; NACL-NEXT: mov[[LQ]] [[FLAGS]], [[AX]]
+; NACL-NEXT: sahf
+; NACL-NEXT: pop[[LQ]] [[AX]]
+; NACL-NEXT: jne
-; CHECK: pushq [[FLAGS]]
-; CHECK: popfq
-; CHECK: jne
%cx = cmpxchg i64* %foo, i64 %bar, i64 %baz seq_cst seq_cst
%p = extractvalue { i64, i1 } %cx, 1
call i32 @bar()
@@ -29,9 +52,13 @@ f:
; Interesting in producing a clobber without any function calls.
define i32 @test_control_flow(i32* %p, i32 %i, i32 %j) {
; CHECK-LABEL: test_control_flow:
-
; CHECK: cmpxchg
; CHECK-NEXT: jne
+
+; NACL-LABEL: test_control_flow:
+; NACL: cmpxchg
+; NACL-NEXT: jne
+
entry:
%cmp = icmp sgt i32 %i, %j
br i1 %cmp, label %loop_start, label %cond.end
@@ -66,15 +93,29 @@ cond.end:
; operand. Naive attempts to limit cmpxchg EFLAGS use are likely to fail here.
define i32 @test_feed_cmov(i32* %addr, i32 %desired, i32 %new) {
; CHECK-LABEL: test_feed_cmov:
-
; CHECK: cmpxchg
-; CHECK: pushfq
-; CHECK: popq [[FLAGS:%.*]]
+; CHECK: pushf[[LQ:[lq]]]
+; CHECK-NEXT: pop[[LQ]] [[FLAGS:%.*]]
+
+; CHECK-NEXT: call[[LQ]] bar
+
+; CHECK-NEXT: push[[LQ]] [[FLAGS]]
+; CHECK-NEXT: popf[[LQ]]
+
+
+; NACL-LABEL: test_feed_cmov:
+; NACL: cmpxchg
+; NACL: push[[LQ:[lq]]] [[AX:%.*]]
+; NACL-NEXT: lahf
+; NACL-NEXT: mov[[LQ]] [[AX]], [[FLAGS:%.*]]
+; NACL-NEXT: pop[[LQ]] [[AX]]
-; CHECK: callq bar
+; NACL-NEXT: call[[LQ]] bar
-; CHECK: pushq [[FLAGS]]
-; CHECK: popfq
+; NACL-NEXT: push[[LQ]] [[AX]]
+; NACL-NEXT: mov[[LQ]] [[FLAGS]], [[AX]]
+; NACL-NEXT: sahf
+; NACL-NEXT: pop[[LQ]] [[AX]]
%res = cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst
%success = extractvalue { i32, i1 } %res, 1
« no previous file with comments | « test/CodeGen/X86/atomic16.ll ('k') | test/CodeGen/X86/fast-isel-gep.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698