1 ;RUN: opt -instcombine -S < %s | llc -mtriple=armv5e--linux-gnueabi | FileCheck %s
2 ;RUN: opt -instcombine -S < %s | llc -mtriple=thumbv4t--linux-gnueabi | FileCheck %s
3 ;RUN: opt -instcombine -S < %s | llc -mtriple=armv6--linux-gnueabi | FileCheck %s
5 ;RUN: opt -instcombine -S < %s | llc -mtriple=armv7--linux-gnueabi | FileCheck %s --check-prefix=RBIT
6 ;RUN: opt -instcombine -S < %s | llc -mtriple=thumbv8--linux-gnueabi | FileCheck %s --check-prefix=RBIT
11 define void @byte_reversal(i8* %p, i32 %n) {
15 for.cond: ; preds = %for.body, %entry
16 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
17 %cmp = icmp ult i32 %i.0, %n
18 br i1 %cmp, label %for.body, label %for.end
20 for.body: ; preds = %for.cond
21 %0 = sext i32 %i.0 to i64
22 %arrayidx = getelementptr inbounds i8, i8* %p, i64 %0
23 %1 = load i8, i8* %arrayidx, align 1
24 %or19 = call i8 @llvm.bitreverse.i8(i8 %1)
25 store i8 %or19, i8* %arrayidx, align 1
26 %inc = add i32 %i.0, 1
29 for.end: ; preds = %for.cond
33 ; Function Attrs: nounwind readnone
34 declare i8 @llvm.bitreverse.i8(i8)