Xamarin Public Jenkins (auto-signing) e19d552987 Imported Upstream version 5.18.0.161
Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
2018-10-19 08:34:24 +00:00

26 lines
897 B
LLVM

; RUN: opt -S -demanded-bits -analyze < %s | FileCheck %s
; RUN: opt -S -disable-output -passes="print<demanded-bits>" < %s 2>&1 | FileCheck %s
; CHECK-DAG: DemandedBits: 0xff000000 for %1 = or i32 %x, 1
; CHECK-DAG: DemandedBits: 0xff for %2 = call i32 @llvm.bitreverse.i32(i32 %1)
; CHECK-DAG: DemandedBits: 0xff for %3 = trunc i32 %2 to i8
define i8 @test_bswap(i32 %x) {
%1 = or i32 %x, 1
%2 = call i32 @llvm.bswap.i32(i32 %1)
%3 = trunc i32 %2 to i8
ret i8 %3
}
declare i32 @llvm.bswap.i32(i32)
; CHECK-DAG: DemandedBits: 0xff000000 for %1 = or i32 %x, 1
; CHECK-DAG: DemandedBits: 0xff for %2 = call i32 @llvm.bswap.i32(i32 %1)
; CHECK-DAG: DemandedBits: 0xff for %3 = trunc i32 %2 to i8
define i8 @test_bitreverse(i32 %x) {
%1 = or i32 %x, 1
%2 = call i32 @llvm.bitreverse.i32(i32 %1)
%3 = trunc i32 %2 to i8
ret i8 %3
}
declare i32 @llvm.bitreverse.i32(i32)