[PATCH] D29668: Elide argument copies during instruction selection

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 19:44:01 PST 2017


majnemer added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8108-8109
+    const Value *Dst = SI->getPointerOperand()->stripPointerCasts();
+    const auto *AI = dyn_cast<AllocaInst>(Dst);
+    StaticAllocaInfo *Info = GetInfoIfStaticAlloca(AI);
+    if (!Info)
----------------
Why not just pass Dst into GetInfoIfStaticAlloca?


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8122
+    if (!Arg || Arg->hasInAllocaAttr() || Arg->hasByValAttr() ||
+        Arg->getType()->isEmptyTy() ||
+        DL.getTypeStoreSize(Arg->getType()) !=
----------------
Would `!Arg->getType()->isSized()` be more precise?


https://reviews.llvm.org/D29668





More information about the llvm-commits mailing list