[PATCH] D153800: [ARM] Adjust strd/ldrd codegen alignment requirements

Maurice Heumann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 10:41:27 PDT 2023


momo5502 added a comment.

Here is the IR code of that specific function. The first load has an align of 4, which used to be excluded by the load optimization before this commit.

  ; Function Attrs: mustprogress nounwind uwtable(sync)
  define linkonce_odr hidden noundef i32 @_ZNK4llvm13format_objectIJxEE7snprintEPcj(ptr noundef nonnull align 8 dereferenceable(16) %this, ptr noundef %Buffer, i32 noundef %BufferSize) unnamed_addr #6 comdat align 2 {
  entry:
    %Fmt.i = getelementptr inbounds %"class.llvm::format_object_base", ptr %this, i32 0, i32 1
    %0 = load ptr, ptr %Fmt.i, align 4, !tbaa !63
    %Vals.i = getelementptr inbounds %"class.llvm::format_object.75", ptr %this, i32 0, i32 1
    %1 = load i64, ptr %Vals.i, align 8, !tbaa !44
    %call2.i = tail call i32 (ptr, i32, ptr, ...) @snprintf(ptr noundef %Buffer, i32 noundef %BufferSize, ptr noundef %0, i64 noundef %1) #26
    ret i32 %call2.i
  }

The diff of lowering that load without the optimization (on the left) and with the optimization from this commit (on the right) is attached.

F28193383: image.png <https://reviews.llvm.org/F28193383>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153800



More information about the llvm-commits mailing list