[PATCH] D20606: [PM] Schedule InstCombine after late LICM run, to clean up LCSSA nodes.

Manuel Jacob via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 16:54:18 PDT 2016


mjacob updated this revision to Diff 58357.
mjacob added a comment.

Fix test.


http://reviews.llvm.org/D20606

Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp
  test/Other/cleanup-lcssa.ll

Index: test/Other/cleanup-lcssa.ll
===================================================================
--- /dev/null
+++ test/Other/cleanup-lcssa.ll
@@ -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()
Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -542,6 +542,9 @@
     // 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.
+    addInstructionCombiningPass(MPM);
   }
 
   // After vectorization and unrolling, assume intrinsics may tell us more


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20606.58357.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160524/515392d1/attachment.bin>


More information about the llvm-commits mailing list