From 8b9081081b4a7aef0e80b51c59707fcb5f751b53 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 4 Mar 2005 23:21:33 +0000 Subject: [PATCH] Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20445 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index a90dde6c8aa..e944672d262 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2563,7 +2563,8 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) { Constant *Mask; if (CI->getType()->isUnsigned()) { unsigned TypeBits = CI->getType()->getPrimitiveSize()*8; - Val &= (1ULL << TypeBits)-1; + if (TypeBits != 64) + Val &= (1ULL << TypeBits)-1; Mask = ConstantUInt::get(CI->getType(), Val); } else { Mask = ConstantSInt::get(CI->getType(), Val);