llvm.org GIT mirror llvm / 28dd960
Fix a crash in APInt::lshr when shiftAmt > BitWidth. Patch by James Benton <jbenton@vmware.com>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158213 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 8 years ago
2 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11341134 // If all the bits were shifted out, the result is 0. This avoids issues
11351135 // with shifting by the size of the integer type, which produces undefined
11361136 // results. We define these "undefined results" to always be 0.
1137 if (shiftAmt == BitWidth)
1137 if (shiftAmt >= BitWidth)
11381138 return APInt(BitWidth, 0);
11391139
11401140 // If none of the bits are shifted out, the result is *this. This avoids
0 ; RUN: llc < %s
1
2 define <8 x i32> @test1(<8 x i32>* %ptr)
3 {
4 %1 = load <8 x i32>* %ptr, align 32
5 %2 = and <8 x i32> %1,
6 ret <8 x i32> %2;
7 }