llvm / llvm/llvm-project

Missed optimization: unnecessary comparison with __builtin_add_overflow and duplicate addition on AArch64

Open
#197,671 4 comments 0 reactions 0 assignees View on GitHub
backend:AArch64 llvm:optimizations missed-optimization
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

When the sum of the first two arguments of __builtin_add_overflow is used instead of its result, Clang emits the same instructions for x64 but an additional comparison on AArch64: https://godbolt.org/z/E1bh1WGM9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.