Add a note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128286 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-03-25 17:32:40 +00:00
parent 6c3891067b
commit ef7b8d9e5a

View File

@ -2238,4 +2238,23 @@ missed cases:
//===---------------------------------------------------------------------===//
define i1 @test1(i32 %x) nounwind {
%and = and i32 %x, 3
%cmp = icmp ult i32 %and, 2
ret i1 %cmp
}
Can be folded to (x & 2) == 0.
define i1 @test2(i32 %x) nounwind {
%and = and i32 %x, 3
%cmp = icmp ugt i32 %and, 1
ret i1 %cmp
}
Can be folded to (x & 2) != 0.
SimplifyDemandedBits shrinks the "and" constant to 2 but instcombine misses the
icmp transform.
//===---------------------------------------------------------------------===//