[CGP] simplify code to get bswap in memcmp expansion; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306452 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjay Patel 2017-06-27 19:31:35 +00:00
parent 040f338ab8
commit 6891a99c36

View File

@ -1969,9 +1969,7 @@ void MemCmpExpansion::emitLoadCompareBlock(unsigned Index, unsigned LoadSize,
Value *LoadSrc2 = Builder.CreateLoad(LoadSizeType, Source2);
if (DL.isLittleEndian()) {
Function *F = LoadCmpBlocks[Index]->getParent();
Function *Bswap = Intrinsic::getDeclaration(F->getParent(),
Function *Bswap = Intrinsic::getDeclaration(CI->getModule(),
Intrinsic::bswap, LoadSizeType);
LoadSrc1 = Builder.CreateCall(Bswap, LoadSrc1);
LoadSrc2 = Builder.CreateCall(Bswap, LoadSrc2);