[PATCH] D150967: [MemCpyOpt] precommit test for memcpy removal for immutable arguments from attributes (NFC)

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 21 04:07:43 PDT 2023


khei4 added inline comments.


================
Comment at: llvm/test/Transforms/MemCpyOpt/memcpy.ll:409
+  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %val1, ptr align 4 %val, i64 1, i1 false)
+  %0 = call noundef i32 @fnr(ptr align 4 noalias readonly %val1)
+  ret i32 %0
----------------
khei4 wrote:
> nikic wrote:
> > Also needs `nocapture`, otherwise the address may be significant.
> Thanks! Yeah, removing memcpy by only `noalias` and `readonly` might broke capturing behavior! 
> Also I noticed `readnone` doesn't need `nocapture`, so I'll add a test for that case :)
> 
> Also I noticed readnone doesn't need nocapture, so I'll add a test for that case :)

Sorry, that's not. Maybe `readnone` only guarantee no-deref, so capturing with `readnone` seems valid. 


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

https://reviews.llvm.org/D150967



More information about the llvm-commits mailing list