85 lines · plain
1; RUN: llc < %s -mtriple=hexagon2 3@si = common global i32 0, align 44@sll = common global i64 0, align 85 6define void @test_op_ignore() nounwind {7entry:8 %t00 = atomicrmw add ptr @si, i32 1 monotonic9 %t01 = atomicrmw add ptr @sll, i64 1 monotonic10 %t10 = atomicrmw sub ptr @si, i32 1 monotonic11 %t11 = atomicrmw sub ptr @sll, i64 1 monotonic12 %t20 = atomicrmw or ptr @si, i32 1 monotonic13 %t21 = atomicrmw or ptr @sll, i64 1 monotonic14 %t30 = atomicrmw xor ptr @si, i32 1 monotonic15 %t31 = atomicrmw xor ptr @sll, i64 1 monotonic16 %t40 = atomicrmw and ptr @si, i32 1 monotonic17 %t41 = atomicrmw and ptr @sll, i64 1 monotonic18 %t50 = atomicrmw nand ptr @si, i32 1 monotonic19 %t51 = atomicrmw nand ptr @sll, i64 1 monotonic20 br label %return21 22return: ; preds = %entry23 ret void24}25 26define void @test_fetch_and_op() nounwind {27entry:28 %t00 = atomicrmw add ptr @si, i32 11 monotonic29 store i32 %t00, ptr @si, align 430 %t01 = atomicrmw add ptr @sll, i64 11 monotonic31 store i64 %t01, ptr @sll, align 832 %t10 = atomicrmw sub ptr @si, i32 11 monotonic33 store i32 %t10, ptr @si, align 434 %t11 = atomicrmw sub ptr @sll, i64 11 monotonic35 store i64 %t11, ptr @sll, align 836 %t20 = atomicrmw or ptr @si, i32 11 monotonic37 store i32 %t20, ptr @si, align 438 %t21 = atomicrmw or ptr @sll, i64 11 monotonic39 store i64 %t21, ptr @sll, align 840 %t30 = atomicrmw xor ptr @si, i32 11 monotonic41 store i32 %t30, ptr @si, align 442 %t31 = atomicrmw xor ptr @sll, i64 11 monotonic43 store i64 %t31, ptr @sll, align 844 %t40 = atomicrmw and ptr @si, i32 11 monotonic45 store i32 %t40, ptr @si, align 446 %t41 = atomicrmw and ptr @sll, i64 11 monotonic47 store i64 %t41, ptr @sll, align 848 %t50 = atomicrmw nand ptr @si, i32 11 monotonic49 store i32 %t50, ptr @si, align 450 %t51 = atomicrmw nand ptr @sll, i64 11 monotonic51 store i64 %t51, ptr @sll, align 852 br label %return53 54return: ; preds = %entry55 ret void56}57 58define void @test_lock() nounwind {59entry:60 %t00 = atomicrmw xchg ptr @si, i32 1 monotonic61 store i32 %t00, ptr @si, align 462 %t01 = atomicrmw xchg ptr @sll, i64 1 monotonic63 store i64 %t01, ptr @sll, align 864 fence seq_cst65 store volatile i32 0, ptr @si, align 466 store volatile i64 0, ptr @sll, align 867 br label %return68 69return: ; preds = %entry70 ret void71}72 73 74define i64 @fred() nounwind {75entry:76 %s0 = cmpxchg ptr undef, i32 undef, i32 undef seq_cst seq_cst77 %s1 = extractvalue { i32, i1 } %s0, 078 %t0 = cmpxchg ptr undef, i64 undef, i64 undef seq_cst seq_cst79 %t1 = extractvalue { i64, i1 } %t0, 080 %u0 = zext i32 %s1 to i6481 %u1 = add i64 %u0, %t182 ret i64 %u183}84 85