Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Nov 5, 2025

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

zyw-bot commented Nov 5, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@e7f7973
patch: llvm/llvm-project@main...dtcxzyw:llvm-project:perf/ptrdiff-imply-nonequal
sha256: 834d3d81199964d34adb511025ac9906a72ad2537af604164e59bf980dd4bcf4
commit: 2d7fe7e

1953 files changed, 248525 insertions(+), 249688 deletions(-)

Improvements:
  adce.NumRemoved 98777 -> 98961 +0.19%
  correlated-value-propagation.NumUDivURemsNarrowedExpanded 1674 -> 1677 +0.18%
  loop-delete.NumBackedgesBroken 43439 -> 43451 +0.03%
  loop-idiom.NumMemCpy 8940 -> 8942 +0.02%
  indvars.NumElimCmp 55092 -> 55102 +0.02%
  correlated-value-propagation.NumSDivs 16933 -> 16936 +0.02%
  correlated-value-propagation.NumPhis 1254257 -> 1254470 +0.02%
  gvn.NumGVNBlocks 191080 -> 191105 +0.01%
  correlated-value-propagation.NumPhiCommon 53754 -> 53759 +0.01%
  loop-simplifycfg.NumTerminatorsFolded 10819 -> 10820 +0.01%
Regressions:
  vector-combine.NumScalarOps 235 -> 232 -1.28%
  bdce.NumRemoved 383994 -> 383447 -0.14%
  gvn.NumGVNEqProp 426714 -> 426223 -0.12%
  correlated-value-propagation.NumSubNSW 77560 -> 77494 -0.09%
  correlated-value-propagation.NumSubNW 114174 -> 114092 -0.07%
  sccp.NumInstRemoved 1940399 -> 1939177 -0.06%
  sccp.NumDeadBlocks 674400 -> 674001 -0.06%
  local.NumPHICSEs 191740 -> 191657 -0.04%
  correlated-value-propagation.NumSubNUW 37051 -> 37035 -0.04%
  simplifycfg.NumHoistCommonInstrs 2432241 -> 2431307 -0.04%

+9 verilator/V3SplitVar.ll
+6 open3d/PointCloud.ll
+5 casadi/optistack_internal.ll
+4 casadi/csparse_cholesky_interface.ll
+2 cvc5/term_tuple_enumerator.ll
+1 proxygen/ParseURL.ll
+1 velox/Variant.ll
+0 abc/giaJf.ll
+0 bdwgc/gc.ll
+0 box2d/imgui_widgets.ll
+0 brotli/compress_fragment_two_pass.ll
+0 freetype/psaux.ll
+0 libigl/point_areas.ll
+0 libsodium/crypto_secretbox_easy.ll
+0 lvgl/lv_svg_parser.ll
+0 lz4/lz4hc.ll
+0 minetest/COBJMeshFileLoader.ll
+0 oiio/iffoutput.ll
+0 openspiel/tabular_best_response_mdp.ll
+0 openvdb/LevelSetMeasure.ll
+0 proj/gie.ll
+0 tev/Common.ll
+0 tomlplusplus/toml.ll
+0 xgboost/adaptive.ll
+0 yosys/viz.ll
-2 arrow/caching.ll
-2 arrow/interfaces.ll
-2 cvc5/ite_utilities.ll
-2 quantlib/gaussian1dfloatfloatswaptionengine.ll
-2 quantlib/hestonslvfdmmodel.ll
-2 quantlib/hestonslvmcmodel.ll
-2 quantlib/piecewiseintegral.ll
-3 llvm/GlobalISelMatchTable.ll
-3 open3d/TriangleMeshSubdivide.ll
-3 opencv/exif.ll
-3 rocksdb/experimental.ll
-3 vcpkg/catch.ll
-4 llvm/AsmParser.ll
-4 llvm/IndirectCallPromotion.ll
-4 llvm/JSON.ll
-4 llvm/LowerTypeTests.ll
-4 open3d/SelectionPolygon.ll
-4 open3d/SelectionPolygonVolume.ll
-4 openspiel/tarok.ll
-4 yaml-cpp/binary.ll
-5 delta-rs/s2xrj2sh770tx8d.ll
-5 gromacs/pme_grid.ll
-6 grpc/frame_goaway.ll
-6 hermes/CFG.ll
-6 libigl/boundary_conditions.ll
-7 boost/sort_by_side_basic.ll
-7 gromacs/neldermead.ll
-7 luau/NonStrictTypeChecker.ll
-7 quantlib/tenoroptionletvts.ll
-8 fish-rs/7ggr7vxi3lrn28dd77bkw6see.ll
-8 opencv/scansegment.ll
-9 opencv/blobdetector.ll
-10 meshlab/dirt_utils.ll
-10 meshlab/filter_create.ll
-10 meshlab/filter_layer.ll
-10 meshlab/seams.ll
-10 opencv/evaluation.ll
-11 ceres/program.ll
-11 tev/Image.ll
-13 cvc5/cardinality_extension.ll
-15 lightgbm/dataset.ll
-16 abseil-cpp/cord.ll
-16 llvm/DFAJumpThreading.ll
-16 llvm/DFAPacketizer.ll
-16 llvm/MachinePipeliner.ll
-19 recastnavigation/catch_amalgamated.ll
-21 ceres/gradient_checker.ll
-32 cvc5/cadical.ll
-37 velox/InPredicate.ll
-48 nlohmann_json/unit-conversions.ll
-66 faiss/NNDescent.ll

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

The provided patch introduces several key changes across multiple LLVM IR files, primarily focused on optimization and code simplification. Here are the major changes:

  1. Addition of nuw (No Unsigned Wrap) flag to sub instructions:
    In numerous locations across various benchmarks (e.g., giaJf.ll, gc.ll, imgui_widgets.ll, brotli, freetype), the sub instruction is updated to include the nuw flag. This indicates that the subtraction does not unsigned-wrap, enabling better optimization opportunities such as loop induction variable analysis and strength reduction.

  2. Elimination of redundant pointer difference computations in favor of zero initialization:
    In several functions (e.g., cord.ll, cvc5, abseil-cpp, LLVM's DFAPacketizer.ll), instead of computing the difference between two pointers via ptrtoint and sub, the code now directly uses 0 in the corresponding phi nodes. This simplifies control flow and removes unnecessary arithmetic when one branch is known to be a no-op.

  3. Simplification of conditional logic using ult instead of negated uge:
    Files like caching.ll and interfaces.ll replace sequences involving icmp uge followed by a negation with a direct icmp ult. This reduces instruction count and improves clarity and potential for further optimization.

  4. Removal of dead or redundant pointer difference calculations before memory operations:
    In casadi, lightgbm, and ceres, intermediate values computing pointer differences (via ptrtoint and sub) are removed when they are only used in conditions already implied by earlier checks. This eliminates unnecessary computation and cleanup of unused values.

  5. Use of llvm.assume to assert non-equality of pointers:
    In ceres/gradient_checker.ll, an explicit llvm.assume(i1 %.not5.i) is added after checking %.not5.i = icmp ne ptr %37, %38, informing the optimizer that the pointers are never equal, enabling more aggressive optimizations downstream.

These changes collectively enhance optimization potential by providing stronger semantic guarantees (nuw, assume), removing redundant computations, and simplifying control flow and data dependencies.

model: qwen-plus-latest
CompletionUsage(completion_tokens=491, prompt_tokens=109986, total_tokens=110477, completion_tokens_details=None, prompt_tokens_details=None)

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