[PATCH] D66778: [Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 18:55:04 PDT 2019


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

I think `ByteOffset` is used *but* the logic you remove is just a copy of what `isDereferenceableAndAlignedPointer` is doing already only worse and also wrong (see my comment below).

LGTM.



================
Comment at: test/Transforms/SROA/addrspacecast.ll:287
 
 define void @select_addrspacecast_gv(i1 %a, i1 %b) {
 ; CHECK-LABEL: @select_addrspacecast_gv(
----------------
Maybe add something like `; Note that the external linkage of @gv doesn't guarantee dereferenceable memory` to make sure people will not fall into the same trap again and understand easily what is happening.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66778





More information about the llvm-commits mailing list