Skip to content

Conversation

@dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Jun 6, 2025

Link: llvm/llvm-project#143208
Requested by: @artagnon

@github-actions github-actions bot mentioned this pull request Jun 6, 2025
@dtcxzyw
Copy link
Owner Author

dtcxzyw commented Jun 6, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@356dc62
patch: llvm/llvm-project#143208
sha256: 76eb5a890e13ceb4de5dd3d8a43b88c5ad54e229248f82b92511edae1697b299
commit: f9e758b

6 files changed, 6900 insertions(+), 7523 deletions(-)

Improvements:
  indvars.NumElimIdentity 1887 -> 1889 +0.11%
  loop-delete.NumBackedgesBroken 46386 -> 46391 +0.01%
Regressions:
  correlated-value-propagation.NumReturns 220 -> 217 -1.36%
  libcalls-shrinkwrap.NumWrappedTwoCond 178 -> 177 -0.56%
  sroa.NumStoresPredicated 3928 -> 3912 -0.41%
  globalopt.NumGlobUses 321 -> 320 -0.31%
  simple-loop-unswitch.NumSwitches 2032 -> 2027 -0.25%
  globalopt.NumAliasesResolved 6795 -> 6779 -0.24%
  early-cse.NumCSECall 29694 -> 29628 -0.22%
  globalopt.NumCXXDtorsRemoved 2126 -> 2122 -0.19%
  build-libcalls.NumWriteErrnoMemOnly 7423 -> 7410 -0.18%
  jump-threading.NumDupes 143257 -> 143010 -0.17%

boost/buffer_multi_polygon_geo.ll fail

50 111 bench/clamav/optimized/crc.ll
14 51 bench/hdf5/optimized/H5checksum.ll
179 383 bench/linux/optimized/i2c-core-smbus.ll
71 235 bench/openmpi/optimized/crc.ll

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Here's a high-level summary of the major changes in this patch:

  1. CRC Table Initialization Simplification
    In bench/clamav/optimized/crc.ll, the function _Z9InitCRC32Pj has been significantly simplified. The loop that initializes the CRC table was removed, and the function now returns immediately if the table is already initialized. This suggests an optimization where redundant initialization checks or precomputed values are eliminated.

  2. Memory Attribute Refinement
    Multiple functions across all files have updated memory attributes (e.g., from memory(argmem: readwrite) to memory(argmem: read)). This indicates improved precision in function memory access modeling, allowing better optimization opportunities by informing the compiler that certain functions do not modify memory through their arguments.

  3. Loop Restructuring and Removal
    Several loops used for CRC byte-wise computation were either restructured or completely removed. For example, in bench/hdf5/optimized/H5checksum.ll and bench/openmpi/optimized/crc.ll, inner loops related to CRC value computation were optimized into simpler forms or replaced with vector/table-based logic. This likely improves performance by reducing control flow complexity and enabling vectorization.

  4. Inlining and Function Specialization
    In bench/linux/optimized/i2c-core-smbus.ll, the PEC (Packet Error Code) calculation function i2c_smbus_pec was greatly simplified and marked as returned. It appears to be inlined or specialized, removing unnecessary branches and computations. This reduces overhead in I²C bus communication handling.

  5. TBAA Metadata Reorganization
    Type-Based Alias Analysis (TBAA) metadata was restructured across multiple files (e.g., !3, !6, !48). These changes reflect updates to how memory accesses are tagged for alias analysis, potentially improving optimization accuracy and correctness when dealing with different data types in memory.

These optimizations primarily focus on reducing redundancy, improving memory attribute accuracy, simplifying CRC logic, and enhancing inlining behavior — all leading to more efficient code generation and better runtime performance.

model: qwen-plus-latest
CompletionUsage(completion_tokens=440, prompt_tokens=48557, total_tokens=48997, completion_tokens_details=None, prompt_tokens_details=None)

@artagnon
Copy link

/close

@github-actions github-actions bot closed this Jun 17, 2025
@dtcxzyw dtcxzyw deleted the test-run15500130580 branch June 30, 2025 11:31
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