[llvm-bugs] [Bug 34937] New: Implicit control flow map broken assertion for readnone function

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 12 18:03:00 PDT 2017


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

            Bug ID: 34937
           Summary: Implicit control flow map broken assertion for
                    readnone function
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mpfergu at gmail.com
                CC: llvm-bugs at lists.llvm.org

D37460 / r315440 seems to have caused a regression. Before this change, the
following program compiled with `opt -gvn minimal64.ll -S` but after, it causes
an assertion failure in the compiler. I've verified that this failure is still
present on trunk as of r315579.



GVN.cpp:1073: bool llvm::GVN::PerformLoadPRE(llvm::LoadInst*,
llvm::GVN::AvailValInBlkVect&, llvm::GVN::UnavailBlkVect&): Assertion
`It->second->getParent() == TmpBB && "Implicit control flow map broken?"'
failed.


Here is a carefully minimized test case (from a failure compiling with our
frontend):


; ModuleID = 'simpler.ll'
source_filename = "bugpoint-output-5fd3360.bc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%ArrayImpl = type { i64, i64 addrspace(100)*, [1 x i64], [1 x i64], [1 x i64],
i64, i64, double addrspace(100)*, double addrspace(100)*, i8, i64 }

; Function Attrs: readnone
declare %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)*) #0

; Function Attrs: readnone
declare i64* @getaddr_i64(i64 addrspace(100)*) #0

define hidden void @wrapon_fn173() {
entry:
  %0 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
  br label %loop

loop:
  %1 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
  %2 = load i64 addrspace(100)*, i64 addrspace(100)** null, align 8
  %3 = call i64* @getaddr_i64(i64 addrspace(100)* %2)
  br label %loop
}

attributes #0 = { readnone }



To reproduce, put the above into minimal64.ll and run `opt -gvn minimal64.ll
-S`.

Note that if the "readnone" attribute is removed from the getaddr functions,
the test will pass.

I'd greatly appreciate any attention you can give to this matter.

Thanks!

-- 
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/20171013/6afc7b52/attachment.html>


More information about the llvm-bugs mailing list