1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

fix comments; NFC

llvm-svn: 272848
This commit is contained in:
Sanjay Patel 2016-06-15 22:01:28 +00:00
parent fac5bcea0f
commit 10ba6d9488

View File

@ -518,9 +518,8 @@ static Value *UpgradeMaskedLoad(IRBuilder<> &Builder, LLVMContext &C,
return Builder.CreateMaskedLoad(Ptr, Align, Mask, Passthru); return Builder.CreateMaskedLoad(Ptr, Align, Mask, Passthru);
} }
// UpgradeIntrinsicCall - Upgrade a call to an old intrinsic to be a call the /// Upgrade a call to an old intrinsic. All argument and return casting must be
// upgraded intrinsic. All argument and return casting must be provided in /// provided to seamlessly integrate with existing context.
// order to seamlessly integrate with existing context.
void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
Function *F = CI->getCalledFunction(); Function *F = CI->getCalledFunction();
LLVMContext &C = CI->getContext(); LLVMContext &C = CI->getContext();
@ -534,18 +533,16 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
StringRef Name = F->getName(); StringRef Name = F->getName();
Value *Rep; Value *Rep;
// Upgrade packed integer vector compares intrinsics to compare instructions // Upgrade packed integer vector compare intrinsics to compare instructions.
if (Name.startswith("llvm.x86.sse2.pcmpeq.") || if (Name.startswith("llvm.x86.sse2.pcmpeq.") ||
Name.startswith("llvm.x86.avx2.pcmpeq.")) { Name.startswith("llvm.x86.avx2.pcmpeq.")) {
Rep = Builder.CreateICmpEQ(CI->getArgOperand(0), CI->getArgOperand(1), Rep = Builder.CreateICmpEQ(CI->getArgOperand(0), CI->getArgOperand(1),
"pcmpeq"); "pcmpeq");
// need to sign extend since icmp returns vector of i1
Rep = Builder.CreateSExt(Rep, CI->getType(), ""); Rep = Builder.CreateSExt(Rep, CI->getType(), "");
} else if (Name.startswith("llvm.x86.sse2.pcmpgt.") || } else if (Name.startswith("llvm.x86.sse2.pcmpgt.") ||
Name.startswith("llvm.x86.avx2.pcmpgt.")) { Name.startswith("llvm.x86.avx2.pcmpgt.")) {
Rep = Builder.CreateICmpSGT(CI->getArgOperand(0), CI->getArgOperand(1), Rep = Builder.CreateICmpSGT(CI->getArgOperand(0), CI->getArgOperand(1),
"pcmpgt"); "pcmpgt");
// need to sign extend since icmp returns vector of i1
Rep = Builder.CreateSExt(Rep, CI->getType(), ""); Rep = Builder.CreateSExt(Rep, CI->getType(), "");
} else if (Name == "llvm.x86.sse2.cvtdq2pd" || } else if (Name == "llvm.x86.sse2.cvtdq2pd" ||
Name == "llvm.x86.sse2.cvtps2pd" || Name == "llvm.x86.sse2.cvtps2pd" ||