Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Oct 21, 2025

Link: llvm/llvm-project#164382
Requested by: @nikic

@github-actions github-actions bot mentioned this pull request Oct 21, 2025
@zyw-bot
Copy link
Collaborator Author

zyw-bot commented Oct 21, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@00092f9
patch: llvm/llvm-project#164382
sha256: d56fa4b1b832092a8eb9935d6ac6e74bf75fe4f1eaa9630bd778542061ed62bc
commit: 848e230

4192 files changed, 587674 insertions(+), 582384 deletions(-)

Improvements:
  licm.NumBOAssociationsHoisted 3583 -> 3589 +0.17%
  memdep.NumCacheNonLocal 19737 -> 19755 +0.09%
  simplifycfg.NumLookupTablesHoles 2575 -> 2577 +0.08%
  correlated-value-propagation.NumSDivs 16936 -> 16947 +0.06%
  licm.NumMovedLoads 622298 -> 622549 +0.04%
  memdep.NumUncacheNonLocal 25286 -> 25296 +0.04%
  adce.NumBranchesRemoved 23076 -> 23082 +0.03%
  licm.NumIntAssociationsHoisted 4085 -> 4086 +0.02%
  correlated-value-propagation.NumSMinMax 9142 -> 9144 +0.02%
  correlated-value-propagation.NumPhiCommon 53264 -> 53274 +0.02%
Regressions:
  build-libcalls.NumInaccessibleMemOrArgMemOnly 9593 -> 7542 -21.38%
  build-libcalls.NumNoAlias 8523 -> 8484 -0.46%
  build-libcalls.NumNoUndef 38631 -> 38514 -0.30%
  gvn.NumGVNInstr 149599 -> 149247 -0.24%
  gvn.NumGVNPRE 149599 -> 149247 -0.24%
  licm.NumMinMaxHoisted 594 -> 593 -0.17%
  build-libcalls.NumNoUnwind 23564 -> 23525 -0.17%
  dse.NumCFGSuccess 8542 -> 8534 -0.09%
  correlated-value-propagation.NumSExt 47288 -> 47244 -0.09%
  instcombine.NegatorNumNegationsFoundInCache 4717 -> 4713 -0.08%

+25 libigl/kkt_inverse.ll
+17 libpng/pngmem.ll
+15 flac/replaygain_analysis.ll
+12 hdf5/H5Rint.ll
+12 yalantinglibs/user_defined_serialization.ll
+10 mold/rust-demangle.ll
+8 jq/st.ll
+8 llama.cpp/ggml-alloc.ll
+7 cpython/Hacl_Hash_Blake2s_Simd128.ll
+6 darktable/tethering.ll
+6 hdf5/h5diff_array.ll
+5 cmake/archive_read_support_format_mtree.ll
+5 git/submodule--helper.ll
+5 libquic/rsa_impl.ll
+5 libzmq/msg.ll
+5 llvm/SmallPtrSet.ll
+5 lz4/lorem.ll
+4 clamav/unpack.ll
+4 cmake/archive_read_disk_posix.ll
+4 darktable/imageio_pnm.ll
+4 openexr/ImfIDManifest.ll
+4 sundials/arkode_lsrkstep.ll
+3 cpython/Hacl_Hash_Blake2b_Simd256.ll
+3 duckdb/fastcover.ll
+3 nuttx/lib_setvbuf.ll
+3 openjdk/PLATFORM_API_LinuxOS_ALSA_MidiUtils.ll
+3 openjdk/splashscreen_sys.ll
+3 openusd/drawModeStandin.ll
+3 zstd/fastcover.ll
+2 darktable/filtering.ll
+2 graphviz/cvt.ll
+2 hdf5/h5tools_str.ll
+2 libquic/cipher.ll
+2 libquic/e_aes.ll
+2 llvm/NestedNameSpecifier.ll
+2 openmpi/pmix_mca_base_open.ll
+2 php/shared_alloc_shm.ll
+2 php/zend.ll
+2 postgres/fe-cancel.ll
+2 sundials/sundials_hashmap.ll
+1 abc/abcReorder.ll
+1 abc/bmcEco.ll
+1 abc/wlnWriteVer.ll
+1 box2d/init.ll
+1 bullet3/b3File.ll
+1 chibicc/parse.ll
+1 chibicc/tokenize.ll
+1 clamav/others_common.ll
+1 darktable/introspection_colorzones.ll
+1 freetype/ftsystem.ll
+1 graphviz/gvpack.ll
+1 hwloc/bitmap.ll
+1 hwloc/memattrs.ll
+1 icu/uwmsg.ll
+1 nanobind/common.ll
+1 openjdk/img_colors.ll
+1 openmpi/unpack.ll
+1 raylib/utils.ll
+1 redis/fpconv.ll
+1 ruby/util.ll
+1 sdl/SDL_malloc.ll
+1 sundials/sundials_nvector_senswrapper.ll
+1 velox/CompactRowSerializer.ll
+1 zlib/gzwrite.ll
+0 abseil-cpp/str_cat_test.ll
-1 darktable/film.ll
-1 fmt/chrono-test.ll
-1 hermes/CSE.ll
-1 hermes/FoldingSet.ll
-1 hermes/Lowering.ll
-1 libquic/a_utctm.ll
-1 llvm/ASTWriter.ll
-1 lvgl/lv_sdl_window.ll
-1 memcached/assoc.ll
-1 opencv/ar_hmdb_benchmark.ll
-1 openjdk/AccelGlyphCache.ll
-1 openmpi/pmix_mca_base_var.ll
-2 flac/options.ll
-2 libzmq/xpub.ll
-2 llvm/LiveIntervalUnion.ll
-2 opencv/calibinit.ll
-2 openjdk/os.ll
-4 hwloc/topology-linux.ll
-4 jq/unicode.ll

@github-actions
Copy link
Contributor

The provided patch introduces several changes across multiple LLVM IR files, primarily focused on memory attribute updates and minor code transformations. Below is a high-level summary of the major changes:

  1. Addition of errnomem: write to Memory Attributes:
    A significant change is the addition of the errnomem: write memory access tag to numerous function declarations and attributes. This applies to various allocation-related functions such as malloc, calloc, realloc, and others. It indicates that these functions may write to errno upon failure, refining the memory model for better optimization and correctness.

  2. Memory Attribute Refinement in Allocation Functions:
    Functions like malloc, calloc, realloc, and free (and their variants) have updated memory attributes across multiple benchmarks (e.g., abc, abseil-cpp, box2d, bullet3, chibicc, cmake, etc.). These now consistently include errnomem: write alongside existing tags like inaccessiblemem: readwrite, improving precision in alias analysis and optimization.

  3. Replacement of Immediate Values with Loads from Memory:
    In several functions (e.g., Abc_NodeBddReorder, read_data, new_initializer), immediate comparisons or uses of values are replaced by explicit load instructions from memory. For example, %val is no longer used directly but loaded via %.val38 = load i32, ptr %3. This suggests improved handling of potentially modified globals or parameters.

  4. Code Restructuring in Critical Sections:
    Some functions exhibit restructuring of control flow, particularly around error handling and cleanup paths (e.g., in b3FileC2 and read_data). Landing pads and cleanup blocks are adjusted to accommodate new PHI node structures and ensure correct dominance, especially when loading values before branching.

  5. Updates to Function Attributes for Consistency:
    Function attribute lists (e.g., attributes #) are updated across files to reflect the new errnomem: write semantics. This includes realigning attribute indices due to insertions and ensuring consistent metadata across declarations and definitions.

These changes enhance the precision of LLVM’s memory model, particularly regarding errno interaction during allocation operations, and improve safety and optimization potential across the analyzed codebases.

model: qwen-plus-latest
CompletionUsage(completion_tokens=479, prompt_tokens=99879, total_tokens=100358, completion_tokens_details=None, prompt_tokens_details=None)

%157 = shl nsw i64 %156, 3
%158 = call ptr @realloc(ptr noundef %153, i64 noundef %157) #33
store ptr %158, ptr @input_files, align 8, !tbaa !12
%159 = load i32, ptr @tokenize_file.file_no, align 4, !tbaa !62
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reload of global -- we can probably avoid this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants