https://llvm.org/bugs/show_bug.cgi?id=28238
Bug ID: 28238 Summary: [InstCombine] icmp slt 0 optimization hinders more optimization Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Scalar Optimizations Assignee: unassignedb...@nondot.org Reporter: spatel+l...@rotateright.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Spinning this off from bug 27869 (and may have a different solution than bug 28221): int f(int i) { return (i == 0) & (i >> 31); } 'i' can't be 0 and have a bit set, so this should return 0. $ ./clang -O1 sneaky_icmp.c -S -o - -emit-llvm ... define i32 @f(i32 %i) { %cmp = icmp eq i32 %i, 0 %conv = zext i1 %cmp to i32 %shr = ashr i32 %i, 31 %and = and i32 %conv, %shr ret i32 %and } -- 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