Skip to content

Conversation

zyw-bot
Copy link
Collaborator

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

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

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

zyw-bot commented Oct 2, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@5f5a84e
patch: llvm/llvm-project#161639
sha256: 75a6360bcad50a10eae44850c53e528c4dd16368de0b9ad7a931a50711afcbdf
commit: 40b34a5

9 files changed, 4435 insertions(+), 4410 deletions(-)

Improvements:
  gvn.NumGVNEqProp 443259 -> 443512 +0.06%
  jump-threading.NumDupes 139278 -> 139279 +0.00%
  simplifycfg.NumSinkCommonInstrs 863408 -> 863411 +0.00%
  simplifycfg.NumSinkCommonCode 395552 -> 395553 +0.00%
  memdep.NumCacheCompleteNonLocalPtr 5516357 -> 5516360 +0.00%
  memdep.NumCacheNonLocalPtr 276260284 -> 276260323 +0.00%
  instcombine.NumDeadInst 42471426 -> 42471428 +0.00%
  instcombine.NumOneIteration 63867199 -> 63867200 +0.00%
  instcombine.NumWorklistIterations 63867199 -> 63867200 +0.00%
Regressions:
  bdce.NumRemoved 398923 -> 398915 -0.00%
  correlated-value-propagation.NumPhis 1294891 -> 1294885 -0.00%
  correlated-value-propagation.NumSelects 232098 -> 232097 -0.00%
  jump-threading.NumThreads 2825474 -> 2825468 -0.00%
  simplifycfg.NumFoldValueComparisonIntoPredecessors 522822 -> 522821 -0.00%
  sccp.NumDeadBlocks 707959 -> 707958 -0.00%
  sccp.NumInstRemoved 2002667 -> 2002665 -0.00%
  gvn.NumGVNSimpl 4584904 -> 4584903 -0.00%
  instcombine.NumCombined 125681909 -> 125681904 -0.00%
  last-run-tracking.NumSkippedPasses 50135991 -> 50135990 -0.00%

+21 wireshark/packet-zebra.ll
+1 zed-rs/83f7cv59nhkcel85ism08ubeo.ll
+0 llvm/SemaExprObjC.ll
-1 llvm/RDFRegisters.ll
-6 spike/memif.ll

Copy link
Contributor

github-actions bot commented Oct 2, 2025

The changes across the provided LLVM IR diffs involve several optimizations and control flow modifications, primarily focused on improving null checks, refining PHI node usage, adjusting branch conditions, and restructuring basic blocks for better code generation. Here are the major changes:

  1. Introduction of explicit null checks in RDFRegisters.ll:
    In two functions (_ZNK4llvm3rdf20PhysicalRegisterInfo8equal_t and _ZNK4llvm3rdf20PhysicalRegisterInfo4lessENS), an explicit icmp ne ptr %ptr, null check is added before a conditional branch that already tests for null. This allows more precise reasoning about pointer validity in subsequent logic, particularly in the .critedge block where the result of this comparison replaces a constant (false or true) in a PHI node, enabling better propagation of null-state information.

  2. Refinement of PHI nodes and critical edge handling in memif.ll:
    The .crit_edge block now merges values from multiple predecessors (including %44 and %.lr.ph), using a PHI node to carry forward the result of a prior icmp ne check. This replaces a direct load and conditional branch with a more optimized pattern that avoids redundant loads and enables earlier elimination of null checks. Additionally, the old ._crit_edge.thread and %.loopexit.critedge blocks are merged or streamlined, reducing control-flow complexity.

  3. Control flow and PHI node restructuring in packet-zebra.ll:
    Significant reorganization occurs in the zebra_route_nexthop function: new blocks like %47, %58, %61, %81, etc., are introduced, and PHI nodes are updated to reflect new predecessor paths. Notably, branching logic based on i8 switches is split into more granular conditions involving and, icmp, and select operations, likely due to improved value range analysis. The .thread212 block now has updated incoming values reflecting these changes, and the exit block uses a new predecessor label (%.thread234), indicating loop unrolling or outlining transformations.

  4. Optimized condition selection in zed-rs:
    In the Rust-generated code, the computation of a boolean result (%spec.select15) is reordered and simplified. A new comparison (%15 = icmp eq i64 %3, 0) is introduced and used in a select instruction (%not..sroa.0.0.i.i19.i), replacing the previous %4-based selection. This suggests improved constant propagation or dead code elimination, leading to a more efficient evaluation of the final boolean return value.

  5. Predecessor list updates in SemaExprObjC.ll:
    The label _ZNK5clang4Sema20isUnevaluatedContextEv.exit.thread gains a new predecessor (%1447) in its preds list, and a PHI node in .critedge492 adjusts its associated block from %1476 to %1477. This indicates local control flow adjustments—likely due to inlining or jump threading—that alter the dominance relationships without changing observable behavior.

Overall, these changes reflect optimization passes such as SimplifyCFG, GVN, SROA, and jump threading, resulting in tighter control flow, reduced redundancy, and better utilization of PHI semantics for state merging.

model: qwen-plus-latest
CompletionUsage(completion_tokens=725, prompt_tokens=11923, total_tokens=12648, completion_tokens_details=None, prompt_tokens_details=None)

@nikic
Copy link

nikic commented Oct 2, 2025

/close

@github-actions github-actions bot closed this Oct 2, 2025
@dtcxzyw dtcxzyw deleted the test-run18187908582 branch October 2, 2025 17:09
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