https://llvm.org/bugs/show_bug.cgi?id=30773
Bug ID: 30773 Summary: cmp should be known true (via CVP?) 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 $ cat cvp.c void g(int * __attribute((aligned(256))) a, int * __attribute((aligned(256))) b, int * __attribute((aligned(256))) c, int n) { for (int i = 0; i < n * 16; ++i) c[i] = a[i] + b[i]; } $ ./clang -O2 cvp.c -S -emit-llvm -o - define void @g(i32* nocapture readonly %a, i32* nocapture readonly %b, i32* nocapture %c, i32 %n) local_unnamed_addr #0 { entry: %cmp10 = icmp sgt i32 %n, 0 br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: %mul = shl nsw i32 %n, 4 <--- %n is positive; %mul must be positive (nsw) %0 = sext i32 %mul to i64 %1 = icmp sgt i64 %0, 1 <--- so this must be true %smax = select i1 %1, i64 %0, i64 1 <--- and this shouldn't be needed ... Is this a deficiency of correlated value propagation? -- 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