Skip to content

pre-commit: PR141010 #2365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

pre-commit: PR141010 #2365

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented May 22, 2025

Link: llvm/llvm-project#141010
Requested by: @dtcxzyw

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

dtcxzyw commented May 22, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@bcdce98
patch: llvm/llvm-project#141010
sha256: d0c06aeb883e926f0ff9e4305a253f1deb614e480f24314f92340bb9715f0801
commit: e7d9d88

30 files changed, 289 insertions(+), 294 deletions(-)

Improvements:
  licm.NumHoisted 5628412 -> 5628416 +0.00%
Regressions:
  licm.NumMovedCalls 35453 -> 35449 -0.01%
  globalsmodref-aa.NumNoMemFunctions 812624 -> 812619 -0.00%
  globalsmodref-aa.NumReadMemFunctions 1242242 -> 1242237 -0.00%
  instcombine.NumDeadInst 45389339 -> 45389329 -0.00%
  instcombine.NumCombined 132017079 -> 132017069 -0.00%

1 1 bench/darktable/optimized/blend_gui.ll
2 2 bench/ffmpeg/optimized/af_adeclick.ll
4 4 bench/ffmpeg/optimized/agm.ll
3 3 bench/flac/optimized/lpc.ll
9 10 bench/ncnn/optimized/roialign.ll
9 10 bench/ncnn/optimized/roialign_x86.ll

Copy link
Contributor

The patch primarily removes the nsz (no signed zeros) flag from several select instructions in LLVM IR across multiple benchmarks. Here are the major changes:

  1. Removal of nsz from select Instructions:
    In multiple functions across blend_gui.ll, af_adeclick.ll, agm.ll, and lpc.ll, the nsz fast-math flag has been removed from select instructions that involve floating-point comparisons. This change aligns with the principle that select inherits fast-math flags from associated floating-point operations but may not require all flags to be explicitly propagated.

  2. Simplification of FP Comparison Logic in ROIAlign Functions:
    In roialign.ll and roialign_x86.ll, calls to @llvm.maxnum.f32 for clamping negative values to zero were replaced with explicit fcmp ole followed by a select. This transformation avoids use of legacy max intrinsics and gives more explicit control over comparison semantics, possibly enabling better optimization or consistency.

  3. Minor PHI Node Adjustments:
    Some PHI nodes in loop headers within roialign.ll and roialign_x86.ll had their incoming block labels updated due to changes in control flow structure after replacing intrinsic usage. These are mostly mechanical updates and don't affect logic.

  4. Cleanup of Unused Declarations:
    The declarations of @llvm.maxnum.f32 in roialign.ll and roialign_x86.ll were removed since they are no longer used after the intrinsic calls were replaced with fcmp + select.

  5. Control Flow Adjustment in Loop Exit Blocks:
    A few exit blocks in loops had their branch targets slightly adjusted in roialign_x86.ll, indicating minor restructuring of the CFG likely due to the removal of intrinsic-based patterns and replacement with basic FP comparison logic.


Summary:
This patch improves semantic clarity and potentially enables better optimization by replacing uses of @llvm.maxnum.f32 with fcmp + select, and by cleaning up unnecessary fast-math flags. It also removes unused function declarations and adjusts control flow and PHIs accordingly.

model: qwen-plus-latest
CompletionUsage(completion_tokens=469, prompt_tokens=6607, total_tokens=7076, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant