diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-12-10 21:58:15 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-12-10 21:58:15 +0000 |
commit | 5a7717e498bc61246375a9df0061afa27d21e322 (patch) | |
tree | 94f451a24757b23f737a19be9df22968c1d11f39 /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | 89cf6d79ebc573647c562e5f2bd6c4d11a839f8b (diff) | |
download | bcm5719-llvm-5a7717e498bc61246375a9df0061afa27d21e322.tar.gz bcm5719-llvm-5a7717e498bc61246375a9df0061afa27d21e322.zip |
ConstantFold, InstSimplify: undef >>a x can be either -1 or 0, choose 0
Zero is usually a nicer constant to have than -1.
llvm-svn: 223969
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 1c5a917cbec..408768e8515 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1422,11 +1422,11 @@ static Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, if (match(Op0, m_AllOnes())) return Op0; - // undef >>a X -> all ones + // undef >>a X -> 0 // undef >>a X -> undef (if it's exact) if (match(Op0, m_Undef())) return isExact ? UndefValue::get(Op0->getType()) - : Constant::getAllOnesValue(Op0->getType()); + : Constant::getNullValue(Op0->getType()); // (X << A) >> A -> X Value *X; |