[PATCH] D23846: [MemCpy] Check for alias in performMemCpyToMemSetOptzn, instead of the identity of two operands

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 14:25:45 PDT 2016


echristo added inline comments.

================
Comment at: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp:1111
@@ -1110,1 +1110,3 @@
                                                MemSetInst *MemSet) {
+  AliasAnalysis &AA = LookupAliasAnalysis();
+
----------------
timshen wrote:
> echristo wrote:
> > Can probably fold this into the conditional since this is the only place it's used.
> If you are talking about:
>   if (LookupAliasAnalysis().isMustAlias(...))
> 
> , then for consistency with other call sites, I like to keep it as is (I searched for "LookupAliasAnalysis()." and found nothing).
> 
> If you are talking about:
>   if (auto &AA = LoopupAliasAnalysis(); AA.isMustAlias(...))
> 
> It's a C++17 feature and we are not quite there yet! :)
Feel free to fix up the other single uses at the same time? :)

That said, I don't feel that strongly here either way.



Repository:
  rL LLVM

https://reviews.llvm.org/D23846





More information about the llvm-commits mailing list