From ef7b8d9e5a66f411b396b4ae8fc6b6640ffb2ba8 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 25 Mar 2011 17:32:40 +0000 Subject: [PATCH] Add a note. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128286 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/README.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 33941f451a0..99616b47c84 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -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. + +//===---------------------------------------------------------------------===// -- 2.34.1