2014-07-29 03:10:57 +02:00
|
|
|
; RUN: llvm-dis < %s.bc| FileCheck %s
|
2014-08-19 23:08:27 +02:00
|
|
|
; RUN: verify-uselistorder < %s.bc
|
2014-07-29 03:10:57 +02:00
|
|
|
|
|
|
|
; memOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2.
|
|
|
|
; The test checks that LLVM does not misread memory related instructions of
|
|
|
|
; older bitcode files.
|
|
|
|
|
|
|
|
define void @alloca(){
|
|
|
|
entry:
|
|
|
|
; CHECK: %res1 = alloca i8
|
|
|
|
%res1 = alloca i8
|
|
|
|
|
|
|
|
; CHECK-NEXT: %res2 = alloca i8, i32 2
|
|
|
|
%res2 = alloca i8, i32 2
|
|
|
|
|
|
|
|
; CHECK-NEXT: %res3 = alloca i8, i32 2, align 4
|
|
|
|
%res3 = alloca i8, i32 2, align 4
|
|
|
|
|
|
|
|
; CHECK-NEXT: %res4 = alloca i8, align 4
|
|
|
|
%res4 = alloca i8, align 4
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @load(){
|
|
|
|
entry:
|
|
|
|
%ptr1 = alloca i8
|
|
|
|
store i8 2, i8* %ptr1
|
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK: %res1 = load i8, i8* %ptr1
|
|
|
|
%res1 = load i8, i8* %ptr1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res2 = load volatile i8, i8* %ptr1
|
|
|
|
%res2 = load volatile i8, i8* %ptr1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res3 = load i8, i8* %ptr1, align 1
|
|
|
|
%res3 = load i8, i8* %ptr1, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res4 = load volatile i8, i8* %ptr1, align 1
|
|
|
|
%res4 = load volatile i8, i8* %ptr1, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res5 = load i8, i8* %ptr1, !nontemporal !0
|
|
|
|
%res5 = load i8, i8* %ptr1, !nontemporal !0
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res6 = load volatile i8, i8* %ptr1, !nontemporal !0
|
|
|
|
%res6 = load volatile i8, i8* %ptr1, !nontemporal !0
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res7 = load i8, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
%res7 = load i8, i8* %ptr1, align 1, !nontemporal !0
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res8 = load volatile i8, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
%res8 = load volatile i8, i8* %ptr1, align 1, !nontemporal !0
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res9 = load i8, i8* %ptr1, !invariant.load !1
|
|
|
|
%res9 = load i8, i8* %ptr1, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res10 = load volatile i8, i8* %ptr1, !invariant.load !1
|
|
|
|
%res10 = load volatile i8, i8* %ptr1, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res11 = load i8, i8* %ptr1, align 1, !invariant.load !1
|
|
|
|
%res11 = load i8, i8* %ptr1, align 1, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res12 = load volatile i8, i8* %ptr1, align 1, !invariant.load !1
|
|
|
|
%res12 = load volatile i8, i8* %ptr1, align 1, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res13 = load i8, i8* %ptr1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}}
|
|
|
|
%res13 = load i8, i8* %ptr1, !nontemporal !0, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res14 = load volatile i8, i8* %ptr1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}}
|
|
|
|
%res14 = load volatile i8, i8* %ptr1, !nontemporal !0, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res15 = load i8, i8* %ptr1, align 1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}}
|
|
|
|
%res15 = load i8, i8* %ptr1, align 1, !nontemporal !0, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res16 = load volatile i8, i8* %ptr1, align 1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}}
|
|
|
|
%res16 = load volatile i8, i8* %ptr1, align 1, !nontemporal !0, !invariant.load !1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @loadAtomic(){
|
|
|
|
entry:
|
|
|
|
%ptr1 = alloca i8
|
|
|
|
store i8 2, i8* %ptr1
|
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK: %res1 = load atomic i8, i8* %ptr1 unordered, align 1
|
|
|
|
%res1 = load atomic i8, i8* %ptr1 unordered, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res2 = load atomic i8, i8* %ptr1 monotonic, align 1
|
|
|
|
%res2 = load atomic i8, i8* %ptr1 monotonic, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res3 = load atomic i8, i8* %ptr1 acquire, align 1
|
|
|
|
%res3 = load atomic i8, i8* %ptr1 acquire, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res4 = load atomic i8, i8* %ptr1 seq_cst, align 1
|
|
|
|
%res4 = load atomic i8, i8* %ptr1 seq_cst, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res5 = load atomic volatile i8, i8* %ptr1 unordered, align 1
|
|
|
|
%res5 = load atomic volatile i8, i8* %ptr1 unordered, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res6 = load atomic volatile i8, i8* %ptr1 monotonic, align 1
|
|
|
|
%res6 = load atomic volatile i8, i8* %ptr1 monotonic, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res7 = load atomic volatile i8, i8* %ptr1 acquire, align 1
|
|
|
|
%res7 = load atomic volatile i8, i8* %ptr1 acquire, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res8 = load atomic volatile i8, i8* %ptr1 seq_cst, align 1
|
|
|
|
%res8 = load atomic volatile i8, i8* %ptr1 seq_cst, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res9 = load atomic i8, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
%res9 = load atomic i8, i8* %ptr1 singlethread unordered, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res10 = load atomic i8, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
%res10 = load atomic i8, i8* %ptr1 singlethread monotonic, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res11 = load atomic i8, i8* %ptr1 singlethread acquire, align 1
|
|
|
|
%res11 = load atomic i8, i8* %ptr1 singlethread acquire, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res12 = load atomic i8, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
%res12 = load atomic i8, i8* %ptr1 singlethread seq_cst, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res13 = load atomic volatile i8, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
%res13 = load atomic volatile i8, i8* %ptr1 singlethread unordered, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res14 = load atomic volatile i8, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
%res14 = load atomic volatile i8, i8* %ptr1 singlethread monotonic, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res15 = load atomic volatile i8, i8* %ptr1 singlethread acquire, align 1
|
|
|
|
%res15 = load atomic volatile i8, i8* %ptr1 singlethread acquire, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
2015-02-27 22:17:42 +01:00
|
|
|
; CHECK-NEXT: %res16 = load atomic volatile i8, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
%res16 = load atomic volatile i8, i8* %ptr1 singlethread seq_cst, align 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @store(){
|
|
|
|
entry:
|
|
|
|
%ptr1 = alloca i8
|
|
|
|
|
|
|
|
; CHECK: store i8 2, i8* %ptr1
|
|
|
|
store i8 2, i8* %ptr1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store volatile i8 2, i8* %ptr1
|
|
|
|
store volatile i8 2, i8* %ptr1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store i8 2, i8* %ptr1, align 1
|
|
|
|
store i8 2, i8* %ptr1, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store volatile i8 2, i8* %ptr1, align 1
|
|
|
|
store volatile i8 2, i8* %ptr1, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store i8 2, i8* %ptr1, !nontemporal !0
|
|
|
|
store i8 2, i8* %ptr1, !nontemporal !0
|
|
|
|
|
|
|
|
; CHECK-NEXT: store volatile i8 2, i8* %ptr1, !nontemporal !0
|
|
|
|
store volatile i8 2, i8* %ptr1, !nontemporal !0
|
|
|
|
|
|
|
|
; CHECK-NEXT: store i8 2, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
store i8 2, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
|
|
|
|
; CHECK-NEXT: store volatile i8 2, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
store volatile i8 2, i8* %ptr1, align 1, !nontemporal !0
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @storeAtomic(){
|
|
|
|
entry:
|
|
|
|
%ptr1 = alloca i8
|
|
|
|
|
|
|
|
; CHECK: store atomic i8 2, i8* %ptr1 unordered, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 unordered, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 monotonic, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 monotonic, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 release, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 release, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 seq_cst, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 seq_cst, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 unordered, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 unordered, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 monotonic, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 monotonic, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 release, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 release, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 seq_cst, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 seq_cst, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread release, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 singlethread release, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
store atomic i8 2, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 singlethread unordered, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 singlethread monotonic, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread release, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 singlethread release, align 1
|
|
|
|
|
|
|
|
; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
store atomic volatile i8 2, i8* %ptr1 singlethread seq_cst, align 1
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @cmpxchg(i32* %ptr,i32 %cmp,i32 %new){
|
|
|
|
entry:
|
|
|
|
;cmpxchg [volatile] <ty>* <pointer>, <ty> <cmp>, <ty> <new> [singlethread] <ordering>
|
|
|
|
|
|
|
|
; CHECK: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new monotonic monotonic
|
|
|
|
; CHECK-NEXT: %res1 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res1 = cmpxchg i32* %ptr, i32 %cmp, i32 %new monotonic monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new monotonic monotonic
|
|
|
|
; CHECK-NEXT: %res2 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res2 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new monotonic monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic
|
|
|
|
; CHECK-NEXT: %res3 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res3 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic
|
|
|
|
; CHECK-NEXT: %res4 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res4 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic
|
|
|
|
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new acquire acquire
|
|
|
|
; CHECK-NEXT: %res5 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res5 = cmpxchg i32* %ptr, i32 %cmp, i32 %new acquire acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acquire acquire
|
|
|
|
; CHECK-NEXT: %res6 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res6 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acquire acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire
|
|
|
|
; CHECK-NEXT: %res7 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res7 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire
|
|
|
|
; CHECK-NEXT: %res8 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res8 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire
|
|
|
|
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new release monotonic
|
|
|
|
; CHECK-NEXT: %res9 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res9 = cmpxchg i32* %ptr, i32 %cmp, i32 %new release monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new release monotonic
|
|
|
|
; CHECK-NEXT: %res10 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res10 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new release monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic
|
|
|
|
; CHECK-NEXT: %res11 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res11 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic
|
|
|
|
; CHECK-NEXT: %res12 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res12 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic
|
|
|
|
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new acq_rel acquire
|
|
|
|
; CHECK-NEXT: %res13 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res13 = cmpxchg i32* %ptr, i32 %cmp, i32 %new acq_rel acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acq_rel acquire
|
|
|
|
; CHECK-NEXT: %res14 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res14 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acq_rel acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire
|
|
|
|
; CHECK-NEXT: %res15 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res15 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire
|
|
|
|
; CHECK-NEXT: %res16 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res16 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire
|
|
|
|
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
; CHECK-NEXT: %res17 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res17 = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
; CHECK-NEXT: %res18 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res18 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst
|
|
|
|
; CHECK-NEXT: %res19 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res19 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst
|
|
|
|
|
|
|
|
; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst
|
|
|
|
; CHECK-NEXT: %res20 = extractvalue { i32, i1 } [[TMP]], 0
|
|
|
|
%res20 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-03-13 19:20:45 +01:00
|
|
|
define void @getelementptr({i8, i8}, {i8, i8}* %s, <4 x i8*> %ptrs, <4 x i64> %offsets ){
|
2014-07-29 03:10:57 +02:00
|
|
|
entry:
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-27 20:29:02 +01:00
|
|
|
; CHECK: %res1 = getelementptr { i8, i8 }, { i8, i8 }* %s, i32 1, i32 1
|
|
|
|
%res1 = getelementptr {i8, i8}, {i8, i8}* %s, i32 1, i32 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-27 20:29:02 +01:00
|
|
|
; CHECK-NEXT: %res2 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %s, i32 1, i32 1
|
|
|
|
%res2 = getelementptr inbounds {i8, i8}, {i8, i8}* %s, i32 1, i32 1
|
2014-07-29 03:10:57 +02:00
|
|
|
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-27 20:29:02 +01:00
|
|
|
; CHECK-NEXT: %res3 = getelementptr i8, <4 x i8*> %ptrs, <4 x i64> %offsets
|
|
|
|
%res3 = getelementptr i8, <4 x i8*> %ptrs, <4 x i64> %offsets
|
2014-07-29 03:10:57 +02:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
!0 = metadata !{ i32 1 }
|
|
|
|
!1 = metadata !{}
|