Fix warning caused by __builtin_expect_with_probability was not handled
in places such as constant folding Previously some places that should have handled __builtin_expect_with_probability is missing, so in some case it acts differently than __builtin_expect. For example it was not handled in constant folding, thus in the following program, the "if" condition should be constantly true and folded, but previously it was not handled and cause warning "control may reach end of non-void function" (while __builtin_expect does not): __attribute__((noreturn)) extern void bar(); int foo(int x, int y) { if (y) { if (__builtin_expect_with_probability(1, 1, 1)) bar(); } else return 0; } Now it's fixed. Differential Revisions: https://reviews.llvm.org/D83362
Loading
Please sign in to comment