[llvm-bugs] [Bug 26021] New: FunctionAttrs marks inaccessiblememonly as readnone

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 4 14:46:53 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26021

            Bug ID: 26021
           Summary: FunctionAttrs marks inaccessiblememonly as readnone
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: deadalnix at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Sample IR:

define i32 @_D8test01824mainFMZi() {
body:
  %0 = tail call noalias i32* @allocmemory()
  store i32 7, i32* %0, align 4
  %1 = tail call noalias i32* @allocmemory()
  %2 = bitcast i32* %1 to i32**
  store i32* %0, i32** %2, align 8
  %3 = tail call noalias i32* @allocmemory()
  %4 = bitcast i32* %3 to i32**
  store i32* %0, i32** %4, align 8
  %5 = load i32, i32* %0, align 4
  %6 = add i32 %5, 1
  store i32 %6, i32* %0, align 4
  %7 = add i32 %5, %6
  ret i32 %7
}

declare noalias i32* @allocmemory() #0

attributes #0 = { inaccessiblememonly }

For some reason, FunctionAttrs want to mark allocmemory as readnone. It turns
out that getModRefBehavior somehow ends up being 0 for it. When the pass it ran
in isolation, everything is fine, but when ran in combination with other passes
using -01, it fails.

I was unable to reduce the set of passes that needs to run.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160104/3e9f756a/attachment.html>


More information about the llvm-bugs mailing list