Skip to content

[CIR] Upstream handling for overflow builtins #163888

@andykaylor

Description

@andykaylor

Overview

Upstream handling for the __builtin_add_overflow, __builtin_sub_overflow, and __builtin_mul_overflow functions, including implemetation and lowering of the cir.binop.overflow operation and the related variations of these builtins.

Suggested minimal test case

bool test_add_overflow_uint_uint_uint(unsigned x, unsigned y, unsigned *res) { return __builtin_add_overflow(x, y, res); } 

Existing incubator tests

clang/test/CIR/CodeGen/builtins-overflow.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClangIRAnything related to the ClangIR project

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions