[llvm-bugs] [Bug 25285] New: GVN removes assumes if there are multiple assumes for the same predicate in a loop

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 22 06:47:23 PDT 2015


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

            Bug ID: 25285
           Summary: GVN removes assumes if there are multiple assumes for
                    the same predicate in a loop
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: michael.m.kuperstein at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Running GVN over the below test case results in both assumes being removed:

define i32 @foo (i32 %val, i1 %k) {
  br label %next

next:
  tail call void @llvm.assume(i1 %k)
  tail call void @llvm.assume(i1 %k)
  %ret = call i32 @do(i32 %val)
  %cont = call i1 @continue(i32 %ret)
  br i1 %cont, label %next, label %end

end:
  ret i32 %ret
}

declare i1 @continue(i32) #0
declare i32 @do(i32) #0
declare void @llvm.assume(i1) #0

attributes #0 = { nounwind }

This does not happen if there is only one assume in the "next" block, or if the
block is not in a loop (e.g. the branch is an unconditional branch to "end")

-- 
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/20151022/e5244680/attachment.html>


More information about the llvm-bugs mailing list