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

            Bug ID: 15811
           Summary: DependenceAnalysis is not access size aware.
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 10398
  --> http://llvm.org/bugs/attachment.cgi?id=10398&action=edit
The patch to add the fail case.

Consider the following function:

define i64 @alias(i32* nocapture %A) nounwind uwtable {
entry:
  %arrayidx = getelementptr inbounds i32* %A, i64 1
  store i32 2, i32* %arrayidx, align 4
  %0 = bitcast i32* %A to i64*
  %1 = load i64* %0, align 8
  ret i64 %1
}

Ignoring size of the memory location accessed in
store i32 2, i32* %arrayidx, align 4
and
%1 = load i64* %0, align 8,

The addresses pointed by %arrayidx and %0 doesn't alias each other, and hence
DependenceAnalysis claims there is not dependencies from the store to the load,
and gives the following output:
da analyze - none!
da analyze - none!
da analyze - none!

However, the above result is incorrect (at least for x86), there should be a
dependency from from the store to the load, because the memory location written
by the store overlap with the memory location read by the load.

-- 
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