https://llvm.org/bugs/show_bug.cgi?id=29009
Bug ID: 29009 Summary: Redundent and instruction caused by switch condition operand shrinking Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Scalar Optimizations Assignee: unassignedb...@nondot.org Reporter: w...@google.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16969 --> https://llvm.org/bugs/attachment.cgi?id=16969&action=edit testcase 1.cc For the testcase 1.cc attached. ~/workarea/llvm-r278451/dbuild/bin/clang -O2 -S 1.cc Here is the code to generate the index to access jump table: movl njob(%rip), %eax callq _Z3goov movl %eax, %edx andb $7, %dl movl %eax, %ecx andl $7, %ecx // There is redundency to compute "and $7, ..." twice. cmpb $7, %dl je .LBB0_3 # BB#2: # %while.cond # in Loop: Header=BB0_1 Depth=1 jmpq *.LJTI0_0(,%rcx,8) Better code is: .LBB0_1: # =>This Inner Loop Header: Depth=1 movl njob(%rip), %eax callq _Z3goov movl %eax, %ecx andl $7, %ecx cmpl $6, %ecx ja .LBB0_3 # BB#2: # in Loop: Header=BB0_1 Depth=1 jmpq *.LJTI0_0(,%rcx,8) Looks like it is caused by r274233 which allows illegal type generated when shrinking switch condition operand. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs