[X86] Attempt to fix a ubsan failure in the autoupgrade of kunpck intrinsics.

llvm-svn: 319911
This commit is contained in:
Craig Topper 2017-12-06 17:54:07 +00:00
parent 2e6e88f689
commit c3c3ebf29d
1 changed files with 1 additions and 1 deletions

View File

@ -1068,7 +1068,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
CI->getArgOperand(1));
} else if (IsX86 && (Name.startswith("avx512.kunpck"))) {
uint64_t Shift = CI->getType()->getScalarSizeInBits() / 2;
uint64_t And = (1 << Shift) - 1;
uint64_t And = (1ULL << Shift) - 1;
Value* LowBits = Builder.CreateAnd(CI->getArgOperand(0), And);
Value* HighBits = Builder.CreateShl(CI->getArgOperand(1), Shift);
Rep = Builder.CreateOr(LowBits, HighBits);