mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
52b426c16a
If the shifter operand is a constant, and all of the bits shifted out are known to be zero, then if X is known non-zero at least one non-zero bit must remain. llvm-svn: 248508
15 lines
437 B
LLVM
15 lines
437 B
LLVM
; RUN: opt -instsimplify -S < %s | FileCheck %s
|
|
|
|
; CHECK-LABEL: @test
|
|
define i1 @test(i8 %p, i8* %pq) {
|
|
%q = load i8, i8* %pq, !range !0 ; %q is known nonzero; no known bits
|
|
%1 = or i8 %p, 2 ; %1[1] = 1
|
|
%2 = and i8 %1, 254 ; %2[0] = 0, %2[1] = 1
|
|
%A = lshr i8 %2, 1 ; We should know that %A is nonzero.
|
|
%x = icmp eq i8 %A, 0
|
|
; CHECK: ret i1 false
|
|
ret i1 %x
|
|
}
|
|
|
|
!0 = !{ i8 1, i8 5 }
|