[llvm-bugs] [Bug 27620] New: O3 pass pipeline does not remove trivial LCSSA node

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 3 11:19:29 PDT 2016


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

            Bug ID: 27620
           Summary: O3 pass pipeline does not remove trivial LCSSA node
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: me at manueljacob.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Given this IR:

define i64 @test() {
entry:
  br label %loop

loop:
  %i = phi i64 [ 0, %entry ], [ %inc, %loop ]
  %inc = add i64 %i, 1
  %cond = tail call i1 @check()
  br i1 %cond, label %loop, label %exit

exit:
  ret i64 %i
}

declare i1 @check()


Running opt -S -O3 on it gives the following output:

define i64 @test() {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %i = phi i64 [ 0, %entry ], [ %inc, %loop ]
  %inc = add i64 %i, 1
  %cond = tail call i1 @check()
  br i1 %cond, label %loop, label %exit

exit:                                             ; preds = %loop
  %i.lcssa = phi i64 [ %i, %loop ]
  ret i64 %i.lcssa
}

declare i1 @check()


Here, the LCSSA pass introduces a trivially removable PHI node in the exit
block.  However, InstCombine (or a similar pass) isn't run after LCSSA in the
pass pipeline.

-- 
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/20160503/7549e1c6/attachment.html>


More information about the llvm-bugs mailing list