[llvm] r265402 - Add missing test for the "Don't delete empty preheaders" added in r265397
Chuang-Yu Cheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 5 07:21:32 PDT 2016
Author: cycheng
Date: Tue Apr 5 09:21:32 2016
New Revision: 265402
URL: http://llvm.org/viewvc/llvm-project?rev=265402&view=rev
Log:
Add missing test for the "Don't delete empty preheaders" added in r265397
Author: Tom Jablin (tjablin)
Added:
llvm/trunk/test/CodeGen/Generic/dont-remove-empty-preheader.ll
Added: llvm/trunk/test/CodeGen/Generic/dont-remove-empty-preheader.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/dont-remove-empty-preheader.ll?rev=265402&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/dont-remove-empty-preheader.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/dont-remove-empty-preheader.ll Tue Apr 5 09:21:32 2016
@@ -0,0 +1,39 @@
+; RUN: opt -codegenprepare -S < %s | FileCheck %s
+; CHECK: for.body.preheader
+
+ at N = common global i32 0, align 4
+ at E = common global i8** null, align 8
+ at B = common global i8** null, align 8
+
+; Function Attrs: nounwind
+define i32 @foo() {
+entry:
+ %0 = load i32, i32* @N, align 4
+ %1 = load i8**, i8*** @E, align 8
+ %2 = load i8**, i8*** @B, align 8
+ %cmp7 = icmp eq i8** %2, %1
+ br i1 %cmp7, label %for.cond.cleanup, label %for.body.preheader
+
+for.body.preheader: ; preds = %entry
+ br label %for.body
+
+for.cond.cleanup.loopexit: ; preds = %for.body
+ %add.lcssa = phi i32 [ %add, %for.body ]
+ br label %for.cond.cleanup
+
+for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
+ %n.0.lcssa = phi i32 [ %0, %entry ], [ %add.lcssa, %for.cond.cleanup.loopexit ]
+ ret i32 %n.0.lcssa
+
+for.body: ; preds = %for.body.preheader, %for.body
+ %I.09 = phi i8** [ %incdec.ptr, %for.body ], [ %2, %for.body.preheader ]
+ %n.08 = phi i32 [ %add, %for.body ], [ %0, %for.body.preheader ]
+ %3 = load i8*, i8** %I.09, align 8
+ %call = tail call i32 @map(i8* %3)
+ %add = add nsw i32 %call, %n.08
+ %incdec.ptr = getelementptr inbounds i8*, i8** %I.09, i64 1
+ %cmp = icmp eq i8** %incdec.ptr, %1
+ br i1 %cmp, label %for.cond.cleanup.loopexit, label %for.body
+}
+
+declare i32 @map(i8*)
More information about the llvm-commits
mailing list