mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[PM] Schedule InstSimplify after late LICM run, to clean up LCSSA nodes.
Summary: The module pass pipeline includes a late LICM run after loop unrolling. LCSSA is implicitly run as a pass dependency of LICM. However no cleanup pass was run after this, so the LCSSA nodes ended in the optimized output. Reviewers: hfinkel, mehdi_amini Subscribers: majnemer, bruno, mzolotukhin, mehdi_amini, llvm-commits Differential Revision: http://reviews.llvm.org/D20606 llvm-svn: 271602
This commit is contained in:
parent
e85b77b60d
commit
d6babe096d
@ -542,6 +542,9 @@ void PassManagerBuilder::populateModulePassManager(
|
||||
// outer loop. LICM pass can help to promote the runtime check out if the
|
||||
// checked value is loop invariant.
|
||||
MPM.add(createLICMPass());
|
||||
|
||||
// Get rid of LCSSA nodes.
|
||||
MPM.add(createInstructionSimplifierPass());
|
||||
}
|
||||
|
||||
// After vectorization and unrolling, assume intrinsics may tell us more
|
||||
|
18
test/Other/cleanup-lcssa.ll
Normal file
18
test/Other/cleanup-lcssa.ll
Normal file
@ -0,0 +1,18 @@
|
||||
; RUN: opt -S -O3 < %s | FileCheck %s
|
||||
|
||||
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:
|
||||
; CHECK-NOT: lcssa
|
||||
ret i64 %i
|
||||
}
|
||||
|
||||
declare i1 @check()
|
Loading…
Reference in New Issue
Block a user