https://bugs.llvm.org/show_bug.cgi?id=38239
Bug ID: 38239
Summary: Missed simplication of division
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org
Hello,
int f1(int x, int y, int z) {
return (z * x) / (z * y);
}
f1(int, int, int):
imul edi, edx
imul esi, edx
mov eax, edi
cdq
idiv esi
ret
Possibly, this can be transformed to "return x / y" ? z = 0 leads to "division
by zero is undefined".
f2(int, int):
mov eax, edi
cdq
idiv esi
ret
--
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