[PATCH] D101017: [NewPM] Make GlobalsAA available earlier in the pipeline

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 10:48:25 PDT 2021


aeubanks added a comment.

ah the issue is LoopIdiomRecognize can't recognize the following as a memcpy:

  @__const.f.c = private unnamed_addr constant [20 x double] [double 1.051000e-01, double 1.570000e-02, double 1.850000e-02, double 0x3F823A29C779A6B5, double 2.190000e-02, double 1.410000e-02, double 9.700000e-03, double 7.580000e-02, double 1.680000e-02, double 1.188000e-01, double 1.635000e-01, double 1.120000e-02, double 3.330000e-02, double 7.770000e-02, double 2.600000e-02, double 5.680000e-02, double 5.230000e-02, double 2.230000e-02, double 3.240000e-02, double 1.195000e-01], align 16
  
  ; Function Attrs: nofree norecurse nosync nounwind uwtable writeonly
  define dso_local void @f(double* nocapture %a) local_unnamed_addr #0 {
  entry:
    br label %for.body
  
  for.cond.cleanup:                                 ; preds = %for.body
    ret void
  
  for.body:                                         ; preds = %entry, %for.body
    %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
    %arrayidx = getelementptr inbounds [20 x double], [20 x double]* @__const.f.c, i64 0, i64 %indvars.iv
    %0 = load double, double* %arrayidx, align 8, !tbaa !4
    %arrayidx2 = getelementptr inbounds double, double* %a, i64 %indvars.iv
    store double %0, double* %arrayidx2, align 8, !tbaa !4
    %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
    %exitcond = icmp ne i64 %indvars.iv.next, 20
    br i1 %exitcond, label %for.body, label %for.cond.cleanup, !llvm.loop !8
  }

because it thinks the store may affect the load, even though the load is from a constant global.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101017/new/

https://reviews.llvm.org/D101017



More information about the cfe-commits mailing list