]> granicus.if.org Git - llvm/commitdiff
[CGP] simplify code to get bswap in memcmp expansion; NFCI
authorSanjay Patel <spatel@rotateright.com>
Tue, 27 Jun 2017 19:31:35 +0000 (19:31 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 27 Jun 2017 19:31:35 +0000 (19:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306452 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenPrepare.cpp

index bae074fb6040cf923c30aaad4f70097a0047739c..7c9f0b2106f29f3bdad0aaff9ac606aa8c4d5e29 100644 (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);