1 ; RUN: llc -mtriple=arm-darwin -mattr=v6 < %s | FileCheck %s 2 ; RUN: llc -mtriple=thumb-darwin -mattr=v6 < %s | FileCheck %s 3 4 5 define void @test1(i16* nocapture %data) { 6 entry: 7 %0 = load i16* %data, align 2 8 %1 = tail call i16 @llvm.bswap.i16(i16 %0) 9 store i16 %1, i16* %data, align 2 10 ret void 11 12 ; CHECK-LABEL: test1: 13 ; CHECK: ldrh r[[R1:[0-9]+]], [r0] 14 ; CHECK: rev16 r[[R1]], r[[R1]] 15 ; CHECK: strh r[[R1]], [r0] 16 } 17 18 19 define void @test2(i16* nocapture %data, i16 zeroext %in) { 20 entry: 21 %0 = tail call i16 @llvm.bswap.i16(i16 %in) 22 store i16 %0, i16* %data, align 2 23 ret void 24 25 ; CHECK-LABEL: test2: 26 ; CHECK: rev16 r[[R1:[0-9]+]], r1 27 ; CHECK: strh r[[R1]], [r0] 28 } 29 30 31 define i16 @test3(i16* nocapture %data) { 32 entry: 33 %0 = load i16* %data, align 2 34 %1 = tail call i16 @llvm.bswap.i16(i16 %0) 35 ret i16 %1 36 37 ; CHECK-LABEL: test3: 38 ; CHECK: ldrh r[[R0:[0-9]+]], [r0] 39 ; CHECK: rev16 r[[R0]], r0 40 } 41 42 declare i16 @llvm.bswap.i16(i16) 43