[PATCH] D74083: MemCpyOpt cannot use ABI alignment even if it was not given

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 12:34:49 PST 2020


nikic added a comment.

  define void @test(i32* nocapture %P) nounwind ssp {
  entry:
    store i32 0, i32* %P
    %add.ptr = getelementptr inbounds i32, i32* %P, i64 1
    %0 = bitcast i32* %add.ptr to i8*
    tail call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 11, i1 false)
    ret void
  }
  
  declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg)

This example no longer preserves the alignment (align 4 from ABI alignment on the store) after your patch. Possibly you need to capture that when populating `Range.Alignment`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74083





More information about the llvm-commits mailing list