Skip to content

Better codegen for overflow checking and extracting that value, and then setting to -1 if it overflows yields better codegen than the much more succinct saturated add instrinsic #117620

Description

@AZero13

https://godbolt.org/z/zPM1f5vjs

Despite these all having the same behavior, not only is the one with the bigger IR resulting in better codegen, but it is also not being optimized to the more succinct saturated add intrinsic

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions