https://bugs.llvm.org/show_bug.cgi?id=45687

            Bug ID: 45687
           Summary: Failure to optimize away abs check based on known
                    range of variable
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

void g();

void f(int i)
{
    __builtin_assume(i >= -1 && i <= 1);

    if (abs(i) > 1)
        g();
}

This can all be optimized out. GCC does this transformation, LLVM does not.

Comparison here : https://godbolt.org/z/cLcicG

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to