Skip to content

pre-commit: PR174355#3398

Closed
zyw-bot wants to merge 2 commits intomainfrom
test-run21432747419
Closed

pre-commit: PR174355#3398
zyw-bot wants to merge 2 commits intomainfrom
test-run21432747419

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Jan 28, 2026

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

@github-actions github-actions bot mentioned this pull request Jan 28, 2026
@zyw-bot
Copy link
Collaborator Author

zyw-bot commented Jan 28, 2026

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@5e3b708
patch: llvm/llvm-project#174355
sha256: 8d7562257f0af2b8fead6627d8cf965954d768f582d632e086d096aecc316893
commit: 6dca834

2 files changed, 88 insertions(+), 88 deletions(-)

Improvements:
Regressions:
  correlated-value-propagation.NumNUW 570663 -> 570575 -0.02%

+0 meshlab/filter_screened_poisson.ll

@github-actions
Copy link
Contributor

This patch applies the nsw (no signed wrap) flag to 64 add i32 instructions across the filter_screened_poisson IR function. All changes are localized to the BSplineEvaluationData class’s evaluation logic — specifically in centerValue, cornerValue, and OffsetToIndex methods — where integer additions feed into sign-extensions (sext i32 to i64) used for indexing.

The major changes are:

  1. Addition overflow semantics tightened: Each modified add is now marked nsw, signaling that the operation is guaranteed not to overflow signed 32-bit integers. This enables LLVM optimizations (e.g., strength reduction, loop simplification, or elimination of redundant overflow checks) by allowing the optimizer to assume well-defined behavior under signed arithmetic.

  2. Consistent pattern across B-spline index computations: The affected adds compute offset-based indices (e.g., %notmask.i.i.iXXX + %some_constant) used in multi-dimensional array or coefficient lookups. The constants (e.g., %65, %103, %945, %1621, etc.) are mostly small offsets or precomputed base indices — suggesting these additions model grid traversal or hierarchical spline evaluation (e.g., child node indexing in octree-like structures).

  3. No change to control flow or data dependencies: All modifications are purely attribute additions to existing add instructions; no new instructions, branches, or operands are introduced. The sext and branching structure remain identical — confirming this is a semantic refinement, not a functional change.

  4. Broad coverage across evaluator variants: Changes span both Evaluator and ChildEvaluator subroutines, indicating the optimization applies uniformly across different levels of the B-spline evaluation hierarchy — likely reflecting consistent invariants in the underlying mesh/point-cloud processing algorithm.

  5. Likely result of improved range analysis or profile-guided optimization: The systematic application of nsw across dozens of similar patterns suggests either (a) a pass (e.g., SimplifyCFG, InstCombine, or LoopVectorize) has proven safe bounds for these adds, or (b) upstream C++ code was annotated (e.g., with __builtin_assume or llvm.assume) or compiled with -fwrapv-incompatible assumptions, enabling stricter IR inference.

In summary: This is a targeted, semantics-preserving optimization that strengthens integer overflow assumptions in B-spline index arithmetic — enabling downstream optimizations while preserving correctness under the established domain constraints.

model: qwen-plus-latest
CompletionUsage(completion_tokens=538, prompt_tokens=20331, total_tokens=20869, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Jan 28, 2026
@dtcxzyw dtcxzyw deleted the test-run21432747419 branch January 28, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants