[PATCH] D134281: [CGP] Update MemIntrinsic alignment if possible
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 06:50:39 PDT 2022
pengfei added inline comments.
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:2224-2230
for (auto &Arg : CI->args()) {
// We want to align both objects whose address is used directly and
// objects whose address is used in casts and GEPs, though it only makes
// sense for GEPs if the offset is a multiple of the desired alignment and
// if size - offset meets the size threshold.
if (!Arg->getType()->isPointerTy())
continue;
----------------
Re-format it.
================
Comment at: llvm/test/CodeGen/X86/memset-2.ll:8-18
+; CHECK-NEXT: movaps %xmm0, 160
+; CHECK-NEXT: movaps %xmm0, 144
+; CHECK-NEXT: movaps %xmm0, 128
+; CHECK-NEXT: movaps %xmm0, 112
+; CHECK-NEXT: movaps %xmm0, 96
+; CHECK-NEXT: movaps %xmm0, 80
+; CHECK-NEXT: movaps %xmm0, 64
----------------
Not sure if the use of `movaps` is a good idea considering the test in below file.
================
Comment at: llvm/test/CodeGen/X86/memset64-on-x86-32.ll:17-34
; SLOW_32-LABEL: bork:
; SLOW_32: # %bb.0:
-; SLOW_32-NEXT: movl $0, 4
-; SLOW_32-NEXT: movl $0, 0
-; SLOW_32-NEXT: movl $0, 12
-; SLOW_32-NEXT: movl $0, 8
-; SLOW_32-NEXT: movl $0, 20
-; SLOW_32-NEXT: movl $0, 16
-; SLOW_32-NEXT: movl $0, 28
-; SLOW_32-NEXT: movl $0, 24
-; SLOW_32-NEXT: movl $0, 36
-; SLOW_32-NEXT: movl $0, 32
-; SLOW_32-NEXT: movl $0, 44
-; SLOW_32-NEXT: movl $0, 40
-; SLOW_32-NEXT: movl $0, 52
-; SLOW_32-NEXT: movl $0, 48
-; SLOW_32-NEXT: movl $0, 60
-; SLOW_32-NEXT: movl $0, 56
-; SLOW_32-NEXT: movl $0, 68
-; SLOW_32-NEXT: movl $0, 64
-; SLOW_32-NEXT: movl $0, 76
-; SLOW_32-NEXT: movl $0, 72
+; SLOW_32-NEXT: xorps %xmm0, %xmm0
+; SLOW_32-NEXT: movaps %xmm0, 64
+; SLOW_32-NEXT: movaps %xmm0, 48
+; SLOW_32-NEXT: movaps %xmm0, 32
+; SLOW_32-NEXT: movaps %xmm0, 16
----------------
Are they intent to use `movl/q` here?
================
Comment at: llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll:14
; CHECK-LABEL: @test_nobuiltin(
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[DST:%.*]], i8 0, i64 [[LEN:%.*]], i1 false) #1
+; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 1 [[DST:%.*]], i8 0, i64 [[LEN:%.*]], i1 false) #[[ATTR1:[0-9]+]]
; CHECK-NEXT: ret void
----------------
No `ATTR1` to match with it. Just removing the `#1` instead?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134281/new/
https://reviews.llvm.org/D134281
More information about the llvm-commits
mailing list