[PATCH] D118440: New regression test against expandMemCpyAsLoop utility

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 21:29:05 PDT 2022


ebrevnov added inline comments.


================
Comment at: llvm/unittests/Transforms/Utils/MemTransferLowering.cpp:64
+  BasicBlock *getBasicBlockByName(Function &F, StringRef Name) const {
+    for (BasicBlock &BB : F)
+      if (BB.getName() == Name)
----------------
arsenm wrote:
> Braces
Ok


================
Comment at: llvm/unittests/Transforms/Utils/MemTransferLowering.cpp:166-167
+        Instruction *Inst = &MemCpyBB->front();
+        assert(isa<MemCpyInst>(Inst) &&
+               "Expecting llvm.memcpy.p0i8.i64 instructon");
+        MemCpyInst *MemCpyI = cast<MemCpyInst>(Inst);
----------------
arsenm wrote:
> This is redundant with the cast<>
Not totally redundant. It gives specific error message if Inst is not a MemCpyInst. Can remove if you like, not a big deal for me :-)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118440/new/

https://reviews.llvm.org/D118440



More information about the llvm-commits mailing list