[llvm-bugs] [Bug 27547] New: EarlyCSE is pessimistic around backedges

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 27 14:50:26 PDT 2016


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

            Bug ID: 27547
           Summary: EarlyCSE is pessimistic around backedges
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: sanjoy at playingwithpointers.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

EarlyCSE optimizes the store in @f0 to store "true", but not the one in @f1. 
Looks like EarlyCSE needlessly depends on %stay having one predecessor.

define void @f0(i32 %x, i1* %ptr) {
 %c = icmp eq i32 %x, 0
 br i1 %c, label %stay, label %leave

leave:
 ret void

stay:
 %c2 = icmp eq i32 %x, 0
 store i1 %c2, i1* %ptr
 ret void
}


define void @f1(i32 %x, i1* %ptr) {
 %c = icmp eq i32 %x, 0
 br i1 %c, label %stay, label %leave

leave:
 ret void

stay:
 %c2 = icmp eq i32 %x, 0
 store i1 %c2, i1* %ptr
 br label %stay
}

-- 
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/20160427/3b9f8134/attachment.html>


More information about the llvm-bugs mailing list