http://llvm.org/bugs/show_bug.cgi?id=19446

            Bug ID: 19446
           Summary: Loop vectorizer cannot generate runtime checks for
                    uniform loads
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 12382
  --> http://llvm.org/bugs/attachment.cgi?id=12382&action=edit
test case showing uniform load

Currently, AccessAnalysis::canCheckPtrAtRT calls hasComputableBounds, and
hasComputableBounds has:

  const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(PtrScev);
  if (!AR)
    return false;
  return AR->isAffine();

so we don't generate runtime checks for uniform loads. For example, if the loop
has:

  %12 = load double* %ref3, align 8, !tbaa !4
  %arrayidx = getelementptr inbounds [10000000 x double]* @c, i64 0, i64
%.idx..015
  %13 = load double* %arrayidx, align 8, !tbaa !4
  %mul5 = fmul double %12, %13

where %ref3 is loop invariant, this loop will not vectorize because we won't
generate the necessary runtime check. I've attached a (simple) test case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to