diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -2920,6 +2920,8 @@ case Instruction::Call: if (auto *II = dyn_cast(I)) { switch (II->getIntrinsicID()) { + case Intrinsic::sshl_sat: + case Intrinsic::ushl_sat: case Intrinsic::abs: case Intrinsic::bitreverse: case Intrinsic::bswap: diff --git a/llvm/test/Analysis/ValueTracking/known-non-zero.ll b/llvm/test/Analysis/ValueTracking/known-non-zero.ll --- a/llvm/test/Analysis/ValueTracking/known-non-zero.ll +++ b/llvm/test/Analysis/ValueTracking/known-non-zero.ll @@ -803,10 +803,7 @@ ; CHECK-LABEL: @sshl_nonzero( ; CHECK-NEXT: [[X_NZ:%.*]] = icmp ne i8 [[XX:%.*]], 0 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_NZ]]) -; CHECK-NEXT: [[X:%.*]] = call i8 @llvm.sshl.sat.i8(i8 [[XX]], i8 [[Y:%.*]]) -; CHECK-NEXT: [[Z:%.*]] = or i8 [[X]], [[IND:%.*]] -; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[Z]], 0 -; CHECK-NEXT: ret i1 [[R]] +; CHECK-NEXT: ret i1 false ; %x_nz = icmp ne i8 %xx, 0 call void @llvm.assume(i1 %x_nz) @@ -833,10 +830,7 @@ ; CHECK-LABEL: @ushl_nonzero( ; CHECK-NEXT: [[X_NZ:%.*]] = icmp ne i8 [[XX:%.*]], 0 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_NZ]]) -; CHECK-NEXT: [[X:%.*]] = call i8 @llvm.ushl.sat.i8(i8 [[XX]], i8 [[Y:%.*]]) -; CHECK-NEXT: [[Z:%.*]] = or i8 [[X]], [[IND:%.*]] -; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[Z]], 0 -; CHECK-NEXT: ret i1 [[R]] +; CHECK-NEXT: ret i1 false ; %x_nz = icmp ne i8 %xx, 0 call void @llvm.assume(i1 %x_nz)