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: [email protected]
Reporter: [email protected]
CC: [email protected]
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs