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

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 10:14:09 PST 2022


jeroen.dobbelaere added a comment.

I checked the testcases for now and found some interesting effects. Can you comment on those ?



================
Comment at: llvm/test/Transforms/LoopIdiom/memcpy-tbaa.ll:45
+; CHECK-NEXT:    [[M2:%.*]] = bitcast double* [[M:%.*]] to i8*
+; CHECK-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[OUT1]], i8* align 8 [[M2]], i64 256, i1 false), !tbaa [[TBAAF:![0-9]+]]
+; CHECK-NEXT:    br label [[FOR_BODY4:%.*]]
----------------
I get `!tbaa %0`. Is this what we would expect ? Shouldn't the tbaa be dropped here ? (float vs double)


================
Comment at: llvm/test/Transforms/LoopIdiom/memcpy-tbaa.ll:81
+; CHECK-NOT:     !tbaa
+; CHECK-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[OUT1]], i8* align 8 [[M2]], i64 256, i1 false) 
+; CHECK-NEXT:    br label [[FOR_BODY4:%.*]]
----------------
`; CHECK-NOT: tbaa`




================
Comment at: llvm/test/Transforms/LoopIdiom/memcpy-tbaa.ll:142
+; CHECK-NEXT:    [[I0:%.*]] = shl nuw i64 [[umax]], 3
+; CHECK-NOT: !tbaa
+; CHECK-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[OUT1]], i8* align 8 [[IN1]], i64 [[I0]], i1 false)
----------------
Shouldn't this be on the next line ?


================
Comment at: llvm/test/Transforms/LoopIdiom/memmove-tbaa.ll:37
+; CHECK-NEXT:    [[M2:%.*]] = bitcast double* [[M]] to i8*
+; CHECK-NEXT:    call void @llvm.memmove.p0i8.p0i8.i64(i8* align 8 [[OUT1]], i8* align 8 [[M2]], i64 256, i1 false), !tbaa [[TBAAF:![0-9]+]]
+; CHECK-NEXT:    br label [[FOR_BODY4:%.*]]
----------------
I get `!tbaa %0`. Is this what we would expect ? Shouldn't the tbaa be dropped here ? (float vs double)


================
Comment at: llvm/test/Transforms/LoopIdiom/memmove-tbaa.ll:64
+; CHECK-NEXT:    [[M2:%.*]] = bitcast double* [[M]] to i8*
+; CHECK-NOT:     !tbaa
+; CHECK-NEXT:    call void @llvm.memmove.p0i8.p0i8.i64(i8* align 8 [[OUT1]], i8* align 8 [[M2]], i64 256, i1 false) 
----------------
This should be on the next line


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