[LLVMbugs] [Bug 11567] New: unnecessary sign extension
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Dec 14 07:09:31 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=11567
Bug #: 11567
Summary: unnecessary sign extension
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: rafael.espindola at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
in
-------------------------------------------
extern void do_something_with(char *arr);
void foo(char **arr, int n) {
for (T i = 0; i < n; i++) {
do_something_with(arr[2*i]);
}
}
------------------------------------------
the loop produced by clang is
movslq %r15d,%r15
mov (%r14,%r15,8),%rdi
callq 1d <foo+0x1d>
add $0x2,%r15d
dec %ebx
jne 11 <foo+0x11>
the loop produced by gcc is
mov 0x0(%rbp),%rdi
inc %ebx
add $0x10,%rbp
callq 1d <foo+0x1d>
cmp %r12d,%ebx
jl e <foo+0xe>
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list