From: Suyog Sarda Date: Thu, 17 Jul 2014 19:07:00 +0000 (+0000) Subject: Rectify r213231. Use proper version of 'ComputeNumSignBits'. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a212203bce418f5df59239087811cdacfdb7542;p=platform%2Fupstream%2Fllvm.git Rectify r213231. Use proper version of 'ComputeNumSignBits'. Earlier when the code was in InstCombine, we were calling the version of ComputeNumSignBits in InstCombine.h that automatically added the DataLayout* before calling into ValueTracking. When the code moved to InstSimplify, we are calling into ValueTracking directly without passing in the DataLayout*. This patch rectifies the same by passing DataLayout in ComputeNumSignBits. llvm-svn: 213295 --- diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 6ac1ae8..7a820a5 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1347,7 +1347,7 @@ static Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, return X; // Arithmetic shifting an all-sign-bit value is a no-op. - unsigned NumSignBits = ComputeNumSignBits(Op0); + unsigned NumSignBits = ComputeNumSignBits(Op0, Q.DL); if (NumSignBits == Op0->getType()->getScalarSizeInBits()) return Op0;