Skip to content

LLVM does not understand that inequality is transitive (even with constraint-elimination) #53273

Closed
@jrmuizel

Description

@jrmuizel

GCC is able to eliminate the third assert in the following code:

#include <assert.h>
void f(int a, int b, int c) {
    assert(a < b);
    assert(b < c);
    assert(a < c);
}

https://gcc.godbolt.org/z/s9a9YM6GK

However, if I change the type from int to unsigned int LLVM is able to figure it out.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions