llvm.org GIT mirror llvm / 55f9513
Merging r155818: ------------------------------------------------------------------------ r155818 | baldrick | 2012-04-30 04:56:58 -0700 (Mon, 30 Apr 2012) | 3 lines Just mark the sign bit as known zero, rather than any other irrelevant bits known zero in the LHS. Fixes PR12541. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_31@155827 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
2 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
563563 Depth+1);
564564 // If it's known zero, our sign bit is also zero.
565565 if (LHSKnownZero.isNegative())
566 KnownZero |= LHSKnownZero;
566 KnownZero.setBit(BitWidth - 1);
567567 }
568568
569569 break;
0 ; RUN: opt -instcombine -S < %s | FileCheck %s
1 ; PR12541
2
3 define i32 @foo(i32 %x) {
4 %y = xor i32 %x, 3
5 %z = srem i32 1656690544, %y
6 %sext = shl i32 %z, 24
7 %s = ashr exact i32 %sext, 24
8 ret i32 %s
9 ; CHECK-NOT: and
10 ; The shifts were wrongly being turned into an and with 112
11 }