support LLVM trunk after 203559 203213 and 203381 revisions

This commit is contained in:
Ilia Filippov
2014-03-12 12:58:50 +04:00
parent e1524891fc
commit ead5cc741d
3 changed files with 23 additions and 6 deletions

View File

@@ -1497,7 +1497,12 @@ define <$1 x $2> @__atomic_compare_exchange_$3_global($2* %ptr, <$1 x $2> %cmp,
per_lane($1, <$1 x MASK> %mask, `
%cmp_LANE_ID = extractelement <$1 x $2> %cmp, i32 LANE
%val_LANE_ID = extractelement <$1 x $2> %val, i32 LANE
%r_LANE_ID = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst
ifelse(LLVM_VERSION,LLVM_3_5,`
%r_LANE_ID = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst seq_cst
',`
%r_LANE_ID = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst
')
%rp_LANE_ID = getelementptr $2 * %rptr32, i32 LANE
store $2 %r_LANE_ID, $2 * %rp_LANE_ID')
@@ -1507,7 +1512,11 @@ define <$1 x $2> @__atomic_compare_exchange_$3_global($2* %ptr, <$1 x $2> %cmp,
define $2 @__atomic_compare_exchange_uniform_$3_global($2* %ptr, $2 %cmp,
$2 %val) nounwind alwaysinline {
%r = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst
ifelse(LLVM_VERSION,LLVM_3_5,`
%r = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst seq_cst
',`
%r = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst
')
ret $2 %r
}
')