[llvm] r249174 - [Tests] Add one more case to LoopUnroll/pr18861.ll for better coverage.
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 12:21:52 PDT 2015
Author: mzolotukhin
Date: Fri Oct 2 14:21:52 2015
New Revision: 249174
URL: http://llvm.org/viewvc/llvm-project?rev=249174&view=rev
Log:
[Tests] Add one more case to LoopUnroll/pr18861.ll for better coverage.
Modified:
llvm/trunk/test/Transforms/LoopUnroll/pr18861.ll
Modified: llvm/trunk/test/Transforms/LoopUnroll/pr18861.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/pr18861.ll?rev=249174&r1=249173&r2=249174&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopUnroll/pr18861.ll (original)
+++ llvm/trunk/test/Transforms/LoopUnroll/pr18861.ll Fri Oct 2 14:21:52 2015
@@ -53,3 +53,34 @@ outer.latch:
%inc9 = add nsw i32 %storemerge1, 1
br label %outer.header
}
+
+; This case is similar to the previous one, and has the same CFG.
+; The difference is that loop unrolling doesn't remove any LCSSA definition,
+; yet breaks LCSSA form for the outer loop. It happens because before unrolling
+; block inner.latch was inside outer loop (and consequently, didn't require
+; LCSSA definition for %x), but after unrolling it occurs out of the outer
+; loop, so we need to insert an LCSSA definition to keep LCSSA.
+
+; Function Attrs: nounwind uwtable
+define void @fn2() {
+entry:
+ br label %outer.header
+
+outer.header:
+ br label %inner.header
+
+inner.header:
+ %x = load i32, i32* undef, align 4
+ br i1 true, label %outer.latch, label %inner.latch
+
+inner.latch:
+ %inc6 = add nsw i32 %x, 1
+ store i32 %inc6, i32* undef, align 4
+ br i1 false, label %inner.header, label %exit
+
+exit:
+ ret void
+
+outer.latch:
+ br label %outer.header
+}
More information about the llvm-commits
mailing list