[PATCH] D108221: [LoopIdiom] Keep TBAA when creating memcpy/memmove

Yueh-Ting Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 23:16:25 PDT 2021


eopXD added a comment.

Is there any intention why this patch misses adding TBAA to `Builder::CreateMemSet`?



================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1387
+  TheLoad->getAAMetadata(AATags);
+  TheStore->getAAMetadata(AATags, /*Merge*/ true);
+
----------------
`/*Merge=*/`


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1397
+          StoreBasePtr, StoreAlign, LoadBasePtr, LoadAlign, NumBytes,
+          /*isVolatile*/ false, AATags.TBAA, AATags.Scope, AATags.NoAlias);
     else
----------------
`/*isVolatile=*/`


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1401
+          Builder.CreateMemCpy(StoreBasePtr, StoreAlign, LoadBasePtr, LoadAlign,
+                               NumBytes, /*isVolatile*/ false, AATags.TBAA,
+                               AATags.TBAAStruct, AATags.Scope, AATags.NoAlias);
----------------
`/*isVolatile=*/`


================
Comment at: llvm/test/Transforms/LoopIdiom/memcpy-tbaa.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -loop-idiom < %s -S | FileCheck %s
+
----------------
Use the new PM.
```
opt -passes="loop-idiom"
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108221



More information about the llvm-commits mailing list