You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sequence in comment 1 actually shows multiple failures. Fixing any of them may solve the larger example, so I forked some over to new bug reports for independent tracking.
I'll keep this one here for now. I'm not sure yet if converting to select if the mask is not a constant is worthwhile - that could potentially lead to other problems because that's not reversible: https://alive2.llvm.org/ce/z/KLS2GM
Extended Description
cat case.c
void foo(void);
static unsigned char f(int *x) { return *x; }
static int b = -1;
int main() {
unsigned char c = f(&b);
unsigned char r = c >= 2 ? 1 : 1 << c;
if (!r)
foo();
b = 0;
}
trunk cannot eliminate the call to foo but 13.0.0 can:
clang-13.0.0 -O3 -S -o /dev/stdout case.c
main: # @main
.cfi_startproc
%bb.0:
.Lfunc_end0:
clang-trunk -O3 -S -o /dev/stdout case.c
main: # @main
.cfi_startproc
%bb.0:
%bb.1:
%bb.2:
.LBB0_3:
movb $1, b(%rip)
xorl %eax, %eax
popq %rcx
.cfi_def_cfa_offset 8
retq
.Lfunc_end0:
clang-trunk -v
clang version 14.0.0 (https://github.com/llvm/llvm-project 693b020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Started with acabad9
The text was updated successfully, but these errors were encountered: