Home | History | Annotate | Download | only in LowerAtomic
      1 ; RUN: opt < %s -loweratomic -S | FileCheck %s
      2 
      3 define i8 @add() {
      4 ; CHECK-LABEL: @add(
      5   %i = alloca i8
      6   %j = atomicrmw add i8* %i, i8 42 monotonic
      7 ; CHECK: [[INST:%[a-z0-9]+]] = load
      8 ; CHECK-NEXT: add
      9 ; CHECK-NEXT: store
     10   ret i8 %j
     11 ; CHECK: ret i8 [[INST]]
     12 }
     13 
     14 define i8 @nand() {
     15 ; CHECK-LABEL: @nand(
     16   %i = alloca i8
     17   %j = atomicrmw nand i8* %i, i8 42 monotonic
     18 ; CHECK: [[INST:%[a-z0-9]+]] = load
     19 ; CHECK-NEXT: and
     20 ; CHECK-NEXT: xor
     21 ; CHECK-NEXT: store
     22   ret i8 %j
     23 ; CHECK: ret i8 [[INST]]
     24 }
     25 
     26 define i8 @min() {
     27 ; CHECK-LABEL: @min(
     28   %i = alloca i8
     29   %j = atomicrmw min i8* %i, i8 42 monotonic
     30 ; CHECK: [[INST:%[a-z0-9]+]] = load
     31 ; CHECK-NEXT: icmp
     32 ; CHECK-NEXT: select
     33 ; CHECK-NEXT: store
     34   ret i8 %j
     35 ; CHECK: ret i8 [[INST]]
     36 }
     37