[PATCH] D36922: [LibCallSimplifier] try harder to fold memcmp with constant arguments

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 13:03:48 PDT 2017


efriedma added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp:778
           IntType->getPointerTo(LHS->getType()->getPointerAddressSpace());
+      LHSV = B.CreateLoad(B.CreateBitCast(LHS, LHSPtrTy), "lhsv");
+    }
----------------
Are you sure this is right?  It looks like it you'll create a dead load if the LHS is aligned, but the RHS isn't (and therefore drive instcombine into an infinite loop).


Repository:
  rL LLVM

https://reviews.llvm.org/D36922





More information about the llvm-commits mailing list