[LLVMbugs] [Bug 14351] New: BasicAA confused after LSR

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 15 03:00:02 PST 2012


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

             Bug #: 14351
           Summary: BasicAA confused after LSR
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Global Analyses
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hfinkel at anl.gov
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9545
  --> http://llvm.org/bugs/attachment.cgi?id=9545
Post-LSR IR

BasicAA is confused by LSR, and this causes aliasing-analysis based dependency
breaking to be ineffective on unrolled loops.

After LSR, the basic form of the loop is:
for.body4:                                        ; preds = %for.body4,
%for.cond2.preheader
  %lsr.iv4 = phi [16000 x double]* [ %11, %for.body4 ], [ bitcast (double*
getelementptr inbounds ([16000 x double]* @Y, i64 0, i64 8)
 to [16000 x double]*), %for.cond2.preheader ]
  %lsr.iv1 = phi [16000 x double]* [ %10, %for.body4 ], [ @X,
%for.cond2.preheader ]
  %lsr.iv = phi i32 [ %lsr.iv.next, %for.body4 ], [ 16000, %for.cond2.preheader
]
  %lsr.iv46 = bitcast [16000 x double]* %lsr.iv4 to <4 x double>*
  %lsr.iv12 = bitcast [16000 x double]* %lsr.iv1 to <4 x double>*
...
 %scevgep11 = getelementptr <4 x double>* %lsr.iv46, i64 -2
  %6 = load <4 x double>* %scevgep11, align 32, !tbaa !0
...
  store <4 x double> %add, <4 x double>* %lsr.iv12, align 32, !tbaa !0
...
  %scevgep = getelementptr [16000 x double]* %lsr.iv1, i64 0, i64 16
  %10 = bitcast double* %scevgep to [16000 x double]*
  %scevgep5 = getelementptr [16000 x double]* %lsr.iv4, i64 0, i64 16
  %11 = bitcast double* %scevgep5 to [16000 x double]*

pointers derived from %lsr.iv4 and %lsr.iv1 come from different underlying
objects, but BasicAA does not see this.

  MayAlias:     <4 x double>* %lsr.iv12, <4 x double>* %scevgep11

The full test case is attached.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list